To change font size of text in paragraph using CSS, you can set the font-size
style property for the paragraph elements with the values like 20px
, 2rem
, 1.1in
, etc.
The following is the typical CSS code to change font size of text in paragraph in HTML page using tag name p
.
p {
font-size: 20px;
}
p {
font-size: 2rem;
}
p {
font-size: 1.1in;
}
We shall go through some working examples on how to change font size of text in paragraph using CSS. In the following examples, you may change the value of font-size and Run the code to visually observe the changes made to the Paragraph elements.
This is an example on how to change font size of text in paragraph using pixels.
You may edit the following code, and click on Run button.
This is an example on how to change font size of text in paragraph using font size relative to parent.
You may edit the following code, and click on Run button.
This is an example on how to change font size of text in paragraph using inches.
You may edit the following code, and click on Run button.