The text-align property specifies the alignment of text inside a block container.

The text-align property contains following information:

  1. value: left, right, center, justify or inherit;
  2. initial: left if direction is set to ltr or right if set to rtl;
  3. applies to: block containers;
  4. inherited: yes;
  5. percentages: N/A;
  6. media: visual;
  7. computed value: initial or specified value.

The left, right and center values refer to the position of the text lines inside a block with the relation to the width of the block. The justify value will try to make both sides of the text line even in respect to the box borders by trying to contract or expand the contents.


CSS text-align property example:


›› go to examples ››