Style textAlign Property
Style textAlign Property
The textAlign property is used to either set or return the horizontal alignment of text in a block-level element.
Syntax:-
Its syntax is:- object.style.textAlign OR object.style.textAlign = left | right | center | justify | initial | inherit
Return:-
Its return is:- string having horizontal alignment of text within the element
Further Explanation:-
Value | Description |
---|---|
left | Aligns text to left. |
right | Aligns text to right. |
center | Centers text. |
justify | The text is justified. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |