CSS2 Test Suite: 16.2 text-align

[index page] [section] [Previous] [Next] [Specification]

The style declarations contained within this page:

.cl1 {text-align: left;}
.cl2 {text-align: right;}
.cl3 {text-align: center;}
.cl4 {text-align: justify;}
.cl5 {text-align: ".";}

[cl1] This sentence should be left-justified.

[cl2] This sentence should be right-justified.

[cl3] This sentence should be centered.

[cl4] This sentence should be fully justified, which means that the right and left margins of this paragraph should line up, no matter how long the paragraph becomes; the exception, of course, is the last line, which should be left-justified in Western languages.

In the following table, all content should align on the period (.) symbol.

451.27$999.95
578.1$12,499.95
450#9.95
1923875.934572$59.95
3.14159265$1499.95
[cl1] This DIV has a class which makes its text alignment left justified. Remember that line-wrapping is necessary in order to fairly test this fact. Within the DIV is a paragraph with a class of cl2, but an inline style of 'text-align: inherit. Thus, the pagraph should also be left justified. And now:

[cl2] This is the paragraph. It should be left justified, just like its parent. If it is righ justified, then inherit is not supported for this property. This is the end of the paragraph.

Here we return to the DIV< which ends here.
[index page] [section] [Previous] [Next] [Specification]