HTML Dog
Skip to navigation

CSS Property: white-space

How white space (such as new lines or a sequence of spaces) should be handled.

Possible Values

ValueDescription
normalWhite space is collapsed and lines are broken to fit.
preWhite space is maintained and lines are not broken. The equivalent of the default styling of the HTML pre element.
nowrapWhite space is collapsed but lines are not broken.
pre-wrapWhite space is maintained but lines are broken.
pre-lineWhite space is collapsed except for new lines, which are not. Lines are also broken to fit.
inherit
initial
unset

Example


pre { white-space: normal; }

#pow { white-space: pre; }

Browser support