Name

white-space

Values:

normal|pre|nowrap

Example:

P.haiku { white-space: pre }

Applies to:

Block-level elements

Inherited:

Yes

This property defines how white space in the source for the element is handled. The normal value treats text normally, with consecutive spaces collapsing to one. The pre value displays multiple characters, like the <pre> tag in HTML, except the element is not displayed in a monospace font. nowrap prevents the text element from wrapping unless designated by a <br> tag.

Get Web Design in a Nutshell 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.