text-wrapBaseline · Newly available
The text-wrap CSS property sets how lines break in text that overflows the container. It is a shorthand for text-wrap-style and text-wrap-mode.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Oct 17, 2024.
Browser support
DesktopChrome
1–129Not supported
130+Supportedsince Oct 15, 2024
Current: 155Edge
12–129Not supported
130+Supportedsince Oct 17, 2024
Current: 154Firefox
1–123Not supported
124+Supportedsince Mar 19, 2024
Current: 157Safari
1–17.4Not supported
17.5+Supportedsince May 13, 2024
Current: 27MobileChrome Android
18–129Not supported
130+Supportedsince Oct 15, 2024
Current: 155Firefox Android
4–123Not supported
124+Supportedsince Mar 19, 2024
Current: 157Safari iOS
1–17.4Not supported
17.5+Supportedsince May 13, 2024
Current: 27How to use
Every current browser supports this, but it only became Baseline on Oct 17, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: text-wrap.
Feature detection
CSS · check before using
@supports (text-wrap: initial) {
/* styles that rely on text-wrap */
}
/* or in JavaScript */
if (CSS.supports("text-wrap", "initial")) {
// use it
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (10). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| text-wrap | 114 | 114 | 121 | 17.4 | 114 | 121 | 17.4 |
| text-wrap-mode | 130 | 130 | 124 | 17.4 | 130 | 124 | 17.4 |
| text-wrap-mode.nowrap | 130 | 130 | 124 | 17.4 | 130 | 124 | 17.4 |
| text-wrap-mode.wrap | 130 | 130 | 124 | 17.4 | 130 | 124 | 17.4 |
| text-wrap-style | 130 | 130 | 124 | 17.5 | 130 | 124 | 17.5 |
| text-wrap-style.auto | 130 | 130 | 124 | 17.5 | 130 | 124 | 17.5 |
| text-wrap-style.stable | 130 | 130 | 124 | 17.5 | 130 | 124 | 17.5 |
| text-wrap.nowrap | 114 | 114 | 124 | 17.4 | 114 | 124 | 17.4 |
| text-wrap.stable | 130 | 130 | 121 | 17.5 | 130 | 121 | 17.5 |
| text-wrap.wrap | 114 | 114 | 124 | 17.4 | 114 | 124 | 17.4 |