text-align

The text-align CSS property sets the horizontal alignment of a block element or table-cell box. This means it works like vertical-align but in the horizontal direction.

Example

Initial value start, or a nameless value that acts as left if direction is ltr, right if direction is rtl if start is not supported by the browser.
Applies to block containers

Syntax

  
text-align: justify;
  

Values

The same as left if direction is left-to-right and right if direction is right-to-left.
The same as right if direction is left-to-right and left if direction is right-to-left.
The inline contents are aligned to the left edge of the line box.
The inline contents are aligned to the right edge of the line box.
The inline contents are centered within the line box.
The inline contents are justified. Text should be spaced to line up its left and right edges to the left and right edges of the line box, except for the last line.
Same as justify, but also forces the last line to be justified.
Similar to inherit, but the values start and end are calculated according to the parent's direction and are replaced by the appropriate left or right value.
When applied to a table cell, specifies the alignment character around which the cell's contents will align.

Browser support

text-align112133.51
block_alignment_values1791151.3
flow_relative_values_start_and_end1791153.1
justify-all
match-parent16794015
string

We use cookies to improve your experience. Learn more in our Privacy policy.

×