Text Align in CSS
The text-align Property
The text-align property specifies the horizontal alignment of text in an element. By default, its value is set to left. However, we can change it to the right, center, or justify.
Syntax:-
Its syntax is:-
< style >
element{
text-align: left| right| center| justify| initial| inherit;
}
< /style >
Further Explanation:-
Value | Description |
---|---|
left | Aligns the text to the left |
right | Aligns the text to the right |
center | Centers the text |
justify | Stretches the lines so that each line has equal width. |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |