|
Set the Text Alignment
By Stephen Bucaro
Use the text-align property to set the text alignment. You can define the
text to be aligned center, left, or right.
<p style="text-align:left;">Text aligned left</p>
Text aligned left
<p style="text-align:right;">Text aligned right</p>
Text aligned right
<p style="text-align:center;">Text centered</p>
Text centered
the text-align property gives you limited control of text position, if you
want more exact control, use the margin-left or margin-right property.
The example below aligns the text 100 pixels from the left.
<p style="margin-left:100px;">Text 100 pixels from left</p>
Text 100 pixels from left
|