coderef

white-space-collapseBaseline · Widely available

The white-space-collapse CSS property sets whether new line characters are shown as line breaks, and whether multiple consecutive spaces are all displayed or combined.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 19, 2024. Widely available since Sep 19, 2026.

Browser support

DesktopChrome
1–113Not supported
114+Supportedsince May 30, 2023
Current: 155
Edge
12–113Not supported
114+Supportedsince Jun 2, 2023
Current: 154
Firefox
1–123Not supported
124+Supportedsince Mar 19, 2024
Current: 157
Safari
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27
MobileChrome Android
18–113Not supported
114+Supportedsince May 30, 2023
Current: 155
Firefox Android
4–123Not supported
124+Supportedsince Mar 19, 2024
Current: 157
Safari iOS
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: white-space-collapse.

Feature detection

CSS · check before using
@supports (white-space-collapse: initial) {
  /* styles that rely on white-space-collapse */
}

/* or in JavaScript */
if (CSS.supports("white-space-collapse", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (6). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
white-space-collapse11411412417.411412417.4
white-space-collapse.break-spaces11411412417.411412417.4
white-space-collapse.collapse11411412417.411412417.4
white-space-collapse.preserve11411412417.411412417.4
white-space-collapse.preserve-breaks11411412417.411412417.4
white-space-collapse.preserve-spaces✕✕124✕✕124✕