text-align

Sets the horizontal alignment of inline-level content inside a block container. It can align text to the left, right, center, or justify it.

Quick example

.centered-text {
  text-align: center;
  /* aligns text to the middle of its container */
}

Quick facts

Initial value
startOrNamelessValueIfLTRRightIfRTL
Inherited
Yes
Applies to
block containers
Animation type
discrete

Values

startendleftrightcenterjustifymatch-parent

text-align Browser Support

Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

Safe to use without fallbacks.

1+
1+
1+
12+
ESC