How to change font family of text in paragraph using CSS?

Answer

To change font family of text in paragraph using CSS, you can set the font-family style property for the paragraph elements with the values like cursive, Tahoma, fantasy, etc.

CSS Code

The following is the typical CSS code to change font family of text in paragraph in HTML page using tag name p.

Using cursive style font

p {
   font-family: cursive;
}

Using Tahoma font family

p {
   font-family: Tahoma;
}

Using fantasy font

p {
   font-family: fantasy;
}

Examples

We shall go through some working examples on how to change font family of text in paragraph 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 Paragraph elements.

Example 1

This is an example on how to change font family of text in paragraph using cursive style font.

You may edit the following code, and click on Run button.

Example 2

This is an example on how to change font family of text in paragraph using Tahoma font family.

You may edit the following code, and click on Run button.

Example 3

This is an example on how to change font family of text in paragraph using fantasy font.

You may edit the following code, and click on Run button.