CSS2 » Properties » text-align

Version: Level 1

Compability: IE4+  N4+

Syntax:
text-align : left | right | center | justify
justify
The justify value adds blank (white) space between adjacent words and characters in order to align both the right and left sides of a block of text. The letter-spacing property can override justification.
center
The center value aligns each line of the text in the center with an equal amount of blank (white) space on each side of the line.
right
The right value aligns the text along its right side.
left
The left value is the default. The text will be aligned along its left side.

The text-align property aligns a specified selection of text. This property is inherited.

Examples

Code:
p.one { text-align:  left; }
p.two { text-align:  center; }
p.three { text-align:  right; }
...
<p class="one">DevGuru</p>
<p class="two">is</p>
<p class="three">great!</p>
Output:

DevGuru

is

great!

Language(s): CSS2

See Also: