KOMPX.COM or COMPMISCELLANEA.COM   

CSS nowrap

Preventing text wrapping by means of CSS:

Preventing this text from wrapping

HTML code:


<div class="nowrap">Preventing this text from wrapping</div>

CSS code:


.nowrap {white-space: nowrap;}

Keeping text from wrapping using CSS - that is, achieving the same effect as with HTML table cell nowrap attribute.

The default value for the white-space property - white-space: normal - brings text wrapping back. Adding <br /> into text overrides CSS command and makes the text to wrap at that point.

Browser support
Windows
Internet Explorer 8.0+
Firefox 1.0+
Google Chrome
Opera 4.0+
Safari 3.1+
SeaMonkey 1.0+
Mozilla 0.6+
Netscape 6.01+
Linux
Firefox 1.0+
Google Chrome / Chromium
Opera 5.0+
SeaMonkey 1.0+
Hv3
Mozilla 0.6+
Netscape 6.01+
More