CSS white-space-collapse Property Reference
The CSS white-space-collapse property is a standard property in CSS Text. Review its formal syntax, computed behavior, and practical declarations.
Updated 2026-08-12
white-space-collapse overview
The CSS white-space-collapse 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 | collapse | preserve | preserve-breaks | preserve-spaces | break-spaces |
| Initial value | collapse |
| 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-collapse. The initial and inherit global keywords remain available even when a property-specific value is preferable.
CSS
.reset-example {
white-space-collapse: initial;
}
.inherit-example {
white-space-collapse: inherit;
}
@supports (white-space-collapse: initial) {
.supported {
white-space-collapse: initial;
}
}