White Space
White space in css is used to control how whitespace is rendered.
Creative, I know.
Normal supresses white space characters and breaks lines based on the width of the element
or the placement of a br tag.
Nowrap will keep all text on one line - often used in conjunction with truncation or a scrollbar. This can be useful
for displaying unix style commands where indicating everything is on one line is important for clarity.
Pre will preserve all whitespace and linebreaks. This is useful for displaying code or poetry. Simulates the rendering of the pre tag.
Examples
This text is formatted the same way in the source and printed three times, with the only difference being which white-space class is attached.
<p class="ws-normal">Content</p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea
takimata
sanctus est
Lorem
ipsum dolor sit amet.
.nowrap
Typography is to literature as musical performance is to composition: an
essential act of interpretation, full of endless opportunities for insight or
obtuseness.
.pre
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea
takimata
sanctus est
Lorem
ipsum dolor sit amet.