To change font family of heading using CSS, you can set the font-family
style property for the heading 2 elements with the values like cursive
, Tahoma
, fantasy
, etc.
The following is the typical CSS code to change font family of heading in HTML page using tag name h2
.
h2 {
font-family: cursive;
}
h2 {
font-family: Tahoma;
}
h2 {
font-family: fantasy;
}
We shall go through some working examples on how to change font family of heading using CSS. In the following examples, you may change the value of font-family and Run the code to visually observe the changes made to the Heading 2 elements.
This is an example on how to change font family of heading using cursive style font.
You may edit the following code, and click on Run button.
This is an example on how to change font family of heading using Tahoma font family.
You may edit the following code, and click on Run button.
This is an example on how to change font family of heading using fantasy font.
You may edit the following code, and click on Run button.