Style Object
The whiteSpace property sets or returns how to handle tabs, line breaks and whitespace in a text.
Set the whiteSpace property:
Return the whiteSpace property:
| Value | Description |
|---|---|
| normal | Collapses sequences of whitespace, and breaks lines automatically. This is default |
| nowrap | Collapses sequences of whitespace, but does not allow line breaks |
| pre | Line breaks and other whitespace are preserved |
| inherit | The value of the whiteSpace property is inherited from parent element |
![]()
The whiteSpace property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".
Preserve line breaks and whitespaces in the text:
Style Object
Your message has been sent to W3Schools.