Syntax: | text-align : value |
---|---|
Possible Values : | left | right | center | justify |
Initial Value : | Determined by browser |
Applies to: | Block-level elements |
Inherited : | Yes |
The text-align property can be applied to block-level elements (P, H2, etc.) to give the alignment of the element's text. This property is similar in function to HTML's ALIGN attribute on paragraphs, headings, and divisions.
Example:
H3 { text-align: center }
P { text-align: right }
see example in action