Text Alignment
How to align the text to right in html using css?
How to position the text?
Usage:
text-align: center;
text-align: left;
text-align: right;
text-align: justify;
Example 1:
How to position the text?
Usage:
text-align: center;
text-align: left;
text-align: right;
text-align: justify;
This will align the text with in the object area.
It takes the following values.
1) center : This value aligns the text to center.
2) left : This value aligns the text to left.
3) right : This value aligns the text to right.
4) justify : This justifies the text with default value.
It takes the following values.
1) center : This value aligns the text to center.
2) left : This value aligns the text to left.
3) right : This value aligns the text to right.
4) justify : This justifies the text with default value.
Example 1:
<div style="text-align: center;">text align</div> Result:
text align
Example 2:
<div style="text-align: left;">text align</div>
Result:
text align
Example 3:
<div style="text-align: right;">text align</div> Result:
text align
Example 4:
<div style="text-align: justify;">text align</div> Result:
text align