CSS textalign Property (original) (raw)
CSS text-align Property
Last Updated : 21 May, 2026
The text-align property in CSS is used to control the horizontal alignment of text inside an element.
- Aligns text to left, right, center, or justify.
- Applies to block-level elements like ,
, etc.
- Inherited by child elements from the parent.
- Common values: left, right, center, justify.
**Syntax:
text-align: left|right|center|justify|initial|inherit;
**Default Value: left if the direction is ltr, and right if the direction is rtl
**Property Value
- **left: It is used to set the text alignment to the left. This is the default property.
- **right: It is used to set the text-alignment to right.
- **center: It is used to set the text alignment into the center.
- **justify: justify is used to spread the words into the complete line i.e., by stretching the content of an element.
- **initial: initial is used to set an element’s CSS property to its default value.
- **inherit: inherit is used to inherit a property to an element from its parent element property value.
Please refer to the CSS Align article for further details.
**Example: This example illustrates the use of the text-align property, to align it to specified values.
HTML `
text-align property