Traditionally, text is either aligned at its left margin or fully justified (often called newspaper style, in which text is aligned at both left and right margins). In addition, for emphasis or special effect, text can be centered on the screen or even right-justified. The text-align property gives you control of the text's alignment and justification (Figure 4.5).
To define text alignment:
1. |
text-align: Type the property name, followed by a colon (:), in the CSS definition list (Code 4.5). Code 4.5. I'm setting up classes for all the various justifications.
| ||||||||||
2. |
left; Set one of the following alignment styles (Table 4.5):
|
Tip
Fully justifying text may produce some strange results on the screen, because spaces between words must be added to make each line the same length. In addition, there is considerable debate about whether full justification helps or hinders readability.