CSS text align

CSS text-align is used to align the text in HTML. This property aligns the text to the left, right, center, etc.

Syntax

Example
lets take the example of HTML paragraph tag contains some text. CSS text align property align it to the right side.

Test it Live

Output

This is a center aligned text.

CSS text align values list

The values and description of this property is used for defining alignment of text.

Sr. No. value Description
1 start Used to align the text to the start edge of the block. The value for this is start.
2 end Used to align the text to the end edge of the block. The value for this is end.
3 left Used to align the text to the left edge of the block. The value for this is left.
4 right Used to align the text to the right edge of the block. The value for this is right.
5 center Used to align the text to the center edge of the block. The value for this is center.
6 justify Used to align the text to the justify edge of the block. The value for this is justify.
7 initial Used to define as the property initial value.
8 inherit Used to define the computed value of property on the elements parent.
9 unset Used to define the property either acts as inherit or initial, depending on the property if it is inherited or not.