CSS White-space Nowrap

Nowrap and nowrap=nowrap ≈ white-space:nowrap

CSS

In this section, I will attempt to document and demonstrate how to overcome some of the little problems that many developers encounter while transitioning from transitional to strict doctypes.

Nowrap and Nowrap=Nowrap

Here’s another one the validator doesn’t like. The deprecated nowrap tag was very handy to keep a line of text from wrapping. It was particularly useful in fluid-width data tables. The CSS equivalent is called white-space, which has several possible values, including nowrap.

.norap { white-space:nowrap; }

To use it,

<!-- nowrap examples -->
<p class="norap">Some unwrappable text</p>
<td class="norap">Some unwrappable table cell text</td>

That was easy! Note that I misspelled “norap” just to make sure it doesn’t collide with “nowrap.”

Leave a Reply

Your email address will not be published.