Sometime it is necessary to set a different strategy to handle white spaces and new lines from the default one web browser use in an element.
The borders of each container elements are visible to show the effects of the different white-space attributes in the following examples.
<p class="pre">Lorem ipsum ...</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!
<p class="nowrap">Lorem ipsum ...</p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod sed diam voluptua.
<p class="truncate">Lorem ipsum ...</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!
/* generate: container-rule */ .pre { white-space: pre; } .nowrap { white-space: nowrap; } .truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } /* end generate */