May 06, 2021 CSS Reference Manual
The white-space property specifies how white space is handled within an element.
Default: | normal |
---|---|
Inherited: | yes |
Version: | CSS1 |
JavaScript syntax: | object .style.whiteSpace="pre" |
Value | Describe |
---|---|
normal | Default. Blanks are ignored by the browser. |
pre | The white space is retained by the browser. It behaves like a label in HTML. |
nowrap | The text does not line, and the text continues on the same line until the label is encountered. |
pre-wrap | The blank character sequence is preserved, but the line breaks normally. |
pre-line | Merges the blank character sequence, but retains the line break. |
inherit | Specifies that the value of the white-space property should be inherited from the parent element. |
The numbers in the table support the first browser version number of the property.
Attributes | |||||
---|---|---|---|---|---|
white-space | 1.0 | 8.0 | 3.5 | 3.0 | 9.5 |
CSS tutorial: CSS Text