CSS text-indent paragraph indentation
I often see that many people have an indentation at the beginning of their articles. With standard typesetting, this is correct, but how to achieve automatic indentation of the first word? In fact, it is quite simple, as long as the CSS text-indent setting can be easily achieved.
The left side of the upper two blocks is a general block, and the block on the right clearly sees the effect of indentation at the beginning of the article, because we use the result of text-indent.
text-indent syntax example
text-indent: 10px;
}
This way of writing means that the first word of the <p> paragraph tag is indented by 10px units. If you are used to using other units, such as em or cm, you can try it yourself. In addition, text-indent can use negative values. If a negative value is used, the first word will protrude forward. When will a negative value be used? It depends on whether you need to design like this!
Post a Comment
0 Comments