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";

Example | Values | center

Δ

Example | Values | justify

Δ

Example | Values | left

Δ

Example | Values | right

Δ

Example | DOM

Δ

References

Δ