Name

white-space — IE4 N/N | IE5 N/Y | NN4 P/P | Op3 N/-

Synopsis

This property defines how whitespace within the element is treated. normal acts like traditional web browsers, in that it reduces any sequence of whitespace to a single space. pre causes whitespace to be treated as it is in the HTML element PRE, with whitespace and returns preserved. nowrap prevents an element from line breaking.

Example

TD {white-space: nowrap;}
TT {white-space: pre;}

Values

normal | pre | nowrap

Default

normal

Inherited

yes

Applies to

block

Get Cascading Style Sheets: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.