Article

text-align

Aligns text horizontally in an element.

Overview

Use the text-align style to specify how the text should be horizontally aligned in an element.

Here's an example that horizontally centers the text in a title element:

<title style="text-align:center">This text is horizontally centered.</title>

Values

left

The text aligns along the left edge of the containing element.

right

The text aligns along the right edge of the containing element.

center

The text aligns with the center of the containing element.

justified

The text is justified in the containing element.

natural

The text aligns based on the default alignment associated with the current localization of the app. The default for left-to-right scripts is left-alignment along the left edge of the containing element. The default alignment for right-to-left scripts is right-alignment along the right edge of the containing element.

Elements that Use text-align

See Also

Element Alignment

tv-align

Aligns an element horizontally inside its parent.

tv-content-align

Aligns an element vertically inside its parent element.

tv-position

Sets the position of an element inside of its parent element.