coderef

stretchLimited availability

The stretch CSS keyword expands a box as needed to fit its contents until the maximum size is reached, without preserving the content's preferred aspect ratio.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Edge
12–137Not supported
138+Supportedsince Jun 26, 2025
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
1–26.6Not supported
27+Supportedsince Sep 14, 2026
Current: 27
MobileChrome Android
18–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
1–26.6Not supported
27+Supportedsince Sep 14, 2026
Current: 27

How to use

Not supported in Firefox, Firefox Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN — see the links below.

Feature detection

CSS · check before using
@supports (height: stretch) {
  /* styles that rely on height: stretch */
}

/* or in JavaScript */
if (CSS.supports("height", "stretch")) {
  // 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
height.stretch138138✕27138✕27
max-height.stretch138138✕27138✕27
max-width.stretch138138✕27138✕27
min-height.stretch138138✕27138✕27
min-width.stretch138138✕27138✕27
width.stretch138138✕27138✕27