Properties
CSS
text-align
The text-align property specifies how inline content of a block is aligned.
text-align: left | right | center | justify | inherit
| Initial: | left if direction is ltr, right if direction is rtl |
| Applies To: | block-level elements, table cells, and inline blocks |
| Inherited: | yes |
| Percentages: | NA |
| Media: | visual |
Values
text-align: value;
| Value: | Description: |
| center | Center text |
| inherit | Takes the same computed value as the property for the element's parent |
| justify | Justify text |
| left | Left-align text |
| right | Right-align text |
DOM
[window.]document.getElementById("element-id").style.textAlign = "text-align";
