Menu
The text-align
property designates the horizontal alignment of text within an element.
Examples:
div.c {
text-align: center;
}
div.l {
text-align: left;
}
div.r {
text-align: right;
}
div.j {
text-align: justify;
}
left
Default value if text direction is left to right. Aligns text to the left.
right
Default value if text direction is right to left. Aligns text to the right.
center
Text is centered.
justify
Like in newspapers and magazines, the text is spaced so that each line is equal width.
initial
Sets the property to its default value.
inherit
Inherits this property’s value from its parent item.
Have a code example of text-align
? Submit a codepen.io demo and we'll showcase it here ↴