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