The text-align property specifies the alignment of text inside a block container.
The text-align property contains following information:
- value: left, right, center, justify or inherit;
- initial: left if direction is set to ltr or right if set to rtl;
- applies to: block containers;
- inherited: yes;
- percentages: N/A;
- media: visual;
- 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: