Indent each line of your text
Do you know that text-indent
can take an extra value each-line
? It allows you to have an indentation after each line! Useful if you rely on <br>
to add new lines.
p {
text-indent: 2em each-line;
}
⚠️ It has limited support. Only Firefox and Safari for now ⚠️
See the Pen Untitled by Temani Afif (@t_afif) on CodePen.
More CSS Tips
- Vertical rounded tabs using CSS mask A few lines of code to get vertical rounded tabs using CSS mask.
- Get the scrollbar width using only CSS A few lines of code to get the scrollbar width within a CSS variable.
- Select the first occurrence of an element in the whole document Select the first occurrence of any element in the whole document.
- 3D parallax effect on hover A perfect 3D parallax illusion using a single image element.