Another typesetting property that CSS allows for the manipulation of is first line indents. This property is controlled via text-indent:
.
This property controls how much the first line of a paragraph is indented.
As with many text properties, this once can be passed absolute values with pixels (px
) or points (pt
). It can also be passed relative values, such as em
s.
In the following example, the text-indent property adjusts the indentations of three paragraph elements inside a “parent” (.parent-1
) div element.
.parent-1 {
text-indent: 1.5em;
background-color: #d6f0ff;
padding: 1em;
}
Ex reprehenderit officia pariatur mollit aliquip eu cillum magna quis. Labore officia incididunt quis laboris veniam quis veniam ad sunt. Minim fugiat consectetur ad consectetur eiusmod quis nostrud do. Deserunt laboris est commodo id Lorem mollit nostrud. Cupidatat culpa officia consequat proident duis nostrud quis nostrud incididunt commodo dolore sit velit.
Laboris excepteur amet incididunt cupidatat tempor non veniam reprehenderit aute minim qui quis ullamco mollit officia nostrud duis. Ut do nulla excepteur ex magna labore labore commodo. Lorem laborum minim occaecat tempor veniam ad consectetur adipisicing magna.
Et et commodo veniam do do enim nisi aliquip enim. Elit nisi officia esse aute ea mollit cillum exercitation. In in mollit laboris officia commodo pariatur mollit ipsum do est do.
[View on GitHub] | [Live Example] |