CSS white-space Property Reference
The CSS white-space property is a standard property in CSS Text. Review its formal syntax, computed behavior, and practical declarations.
Updated 2026-08-12
white-space overview
The CSS white-space property is a standard property in CSS Text. Review its formal syntax, computed behavior, and practical declarations.
The computed value normally inherits from the parent element when no declaration wins the cascade.
Syntax and formal definition
| Field | Value |
|---|---|
| Formal syntax | normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'> |
| Initial value | normal |
| Applies to | allElements |
| Inherited | Yes |
| Percentages | no |
| Computed value | asSpecified |
| Animation type | discrete |
| Media | visual |
| Specification group | CSS Text |
| Status | Standard |
Practical examples
These declarations demonstrate valid ways to set white-space. The initial and inherit global keywords remain available even when a property-specific value is preferable.
CSS
.reset-example {
white-space: initial;
}
.inherit-example {
white-space: inherit;
}
@supports (white-space: initial) {
.supported {
white-space: initial;
}
}