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.

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

white-space-collapse formal syntax
FieldValue
Formal syntaxcollapse | preserve | preserve-breaks | preserve-spaces | break-spaces
Initial valuecollapse
Applies toallElements
InheritedYes
Percentagesno
Computed valueasSpecified
Animation typediscrete
Mediavisual
Specification groupCSS Text
StatusStandard

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.

white-space-collapse live example
CSS .reset-example { white-space-collapse: initial; } .inherit-example { white-space-collapse: inherit; } @supports (white-space-collapse: initial) { .supported { white-space-collapse: initial; } }

Description

The CSS white-space-collapse property is a standard property in CSS Text. Review its formal syntax, computed behavior, and practical declarations.

References

  1. MDN: white-space-collapse
  2. MDN: CSS Properties Reference

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies