CSS2 Test Suite: 16.6 white-space

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

The style declarations contained within this page:

.cl1 {white-space: pre;}
.cl2 {white-space: nowrap;}
.cl3 {white-space: normal;}


[cl1] This paragraph should show extra space where there would ordinarily not be any. There should also be preservation of returns as this sentence very clearly demonstrates.

[cl2] This paragraph should not word-wrap, no matter how long the paragraph might be or over how many lines it would ordinarily wrap, as it has been set to white-space: nowrap and that should have the obvious effect.

[cl1] This paragraph should show extra space, [cl3] except in the second half.

This is a DIV set to white-space: pre (note the extra spaces after sentences). It contains a paragraph with a class of cl3, but also an inline style which sets white-space: inherit. Thus, the paragraph should be have preformatted white space. And now:

This is the paragraph, which should use preformatted white space. Relatively long lines are needed to provide the best test for this effect. The paragraph ends here.

Here we return to the DIV -- note the extra spacing -- which also ends here.

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