CSS property: text-align

Description

This property describes how inline contents of a block are horizontally aligned if the contents do not completely fill the line box.

If two keywords are given in combination, then the first value specifies the alignment of the first line and any line immediately after a forced line break; and the second value specifies the alignment of any remaining lines.

A block of text is a stack of line boxes. In the case of start, end, left, right and center, this property specifies how the inline-level boxes within each line box align with respect to the start and end sides of the line box: alignment is not with respect to the viewport or containing block.

In the case of justify, the UA may stretch or shrink any inline boxes by adjusting their text in addition to shifting their positions. (See also text-justify, letter-spacing, and word-spacing.) If an element's white space is set to be collapsible, then the UA is not required to adjust its text for the purpose of justification and may instead treat the text as having no expansion opportunities. If the UA chooses to adjust the text, then it must ensure that tab stops continue to line up as required by the white space processing rules.