v153 · html · css · shipped
Responsively-sized <iframe>
A browser-native mechanism that lets an <iframe> automatically size itself to match the intrinsic height of its embedded document — without scrollbars, JavaScript resize observers, or wrapper hacks — by combining a new CSS property on the embedding side with an opt-in meta tag in the embedded document. Ships in Chrome 153.
at a glance
| Shipped in | Chrome 153 (status tracking; see ship status note below) |
|---|---|
| Status | Proposed / Intent to Ship (desktop 154 in ChromeStatus) |
| Spec | CSS Sizing Level 4 — Responsive iframes |
| Explainer | css-sizing-4 responsive-iframes-explainer.md |
| Standards issues | WHATWG HTML #555 · CSSWG #1771 · HTML PR #12444 |
| Blink Intent & Bug | Intent to Ship · Bug 418397278 |
| ChromeStatus | 5108373464547328 — Responsively-sized <iframe> |
why it exists
Embedding a third-party widget or a self-contained page in an <iframe> almost always requires workarounds to avoid scrollbars: the padding-bottom percentage hack, ResizeObserver inside the iframe sending postMessage to the parent, or server-side knowledge of the content height. None of these are reliable across all content types, and the postMessage approach requires cooperation between two independent codebases.
The responsively-sized iframe feature provides a declarative, standards-based alternative. The iframe element automatically shrinks or grows to fit its content at load time — no scripting required on either side.
Source: css-sizing-4 responsive-iframes-explainer.md; WHATWG HTML issue #555.Syntax and double opt-in
/* 1. Embedding side: CSS property definition */
iframe {
frame-sizing: auto | content-width | content-height | content-block-size | content-inline-size;
}
<!-- 2. Embedded side: HTML document opt-in meta tag -->
<meta name="responsive-embedded-sizing" content="allow-origins=*">
Both sides must opt in — the embedding document and the embedded document — before the feature activates. This protects cross-origin privacy: neither party can measure the other's content without explicit consent.
embedding document: the CSS property
/* In the embedding page's stylesheet */
iframe.auto-height {
frame-sizing: content-height;
width: 100%;
}
Setting frame-sizing: content-height on the <iframe> element tells the browser to size the element's height based on the embedded document's natural (intrinsic) height once loaded.
embedded document: the meta tag
<!-- In the embedded document's <head> -->
<meta name="responsive-embedded-sizing" content="allow-origins=*">
The embedded document opts in by including this meta tag. The tag must be present when the load event fires for the sizing to take effect.
Inputs and outputs
Inputs: On the parent element, frame-sizing accepts keywords: auto (default static fallback sizing), content-height (or logical content-block-size), and content-width (or logical content-inline-size). On the embedded document, the <meta name="responsive-embedded-sizing"> accepts an optional content attribute such as allow-origins=* or a list of authorized embedding origins.
Outputs: When both opt-ins match at document load time, the browser computes the embedded document's layout overflow rectangle and overrides the iframe element's natural dimension on the opted-in axis. This eliminates vertical scrollbars within the iframe while preventing arbitrary script-driven frame oscillation.
Source: CSS Sizing 4 §5.3; css-sizing-4 responsive-iframes-explainer.md.Errors and lifecycle
Errors: If either side omits the opt-in, or if the embedded meta tag specifies origin restrictions that do not include the embedding parent origin, the browser silently ignores frame-sizing and falls back to standard replaced-element dimensions (300px × 150px) with scrollbars. No JavaScript errors or CSS parse exceptions are thrown, adhering to standard CSS resilient fallback rules.
Lifecycle: Responsive sizing is evaluated strictly one-shot at the completion of the child document's load event. Subsequent DOM mutations or style shifts inside the iframe do not trigger re-sizing, precluding layout cycles and Cumulative Layout Shift (CLS) regressions.
Examples
The following end-to-end example illustrates the required cooperative markup on both the embedding parent and the embedded child document:
<!-- embedding page -->
<!doctype html>
<html><head>
<style>
.widget-frame {
frame-sizing: content-height;
width: 100%;
border: 1px solid #ccc;
}
</style>
</head><body>
<iframe class="widget-frame" src="https://widget.example.com/"></iframe>
</body></html>
<!-- embedded document: widget.example.com -->
<!doctype html>
<html><head>
<meta name="responsive-embedded-sizing" content="allow-origins=*">
<style>body { margin: 0; }</style>
</head><body>
<p>Widget content that determines the iframe height.</p>
<p>More content here.</p>
</body></html>
The iframe renders without a fixed height and without scrollbars. Its height matches the widget's layout overflow height at load time.
Source: css-sizing-4 responsive-iframes-explainer.md.behaviour and constraints
| Behaviour | Detail |
|---|---|
| Timing | One-shot at load time only. Subsequent content changes do not trigger re-sizing, preventing layout loops and performance issues. |
| Direction | Height sizing only in initial shipping phase. Width is still controlled by the embedding document as normal. |
| Cross-origin | Works across origins — both parties must opt in explicitly. |
| Fallback | If the embedded document does not include the meta tag, the iframe falls back to its normal (scrollable) behaviour; frame-sizing has no effect. |
| Meta timing | The meta tag must be present in the document at the time the load event fires. Dynamically adding it afterwards does not activate the feature. |
browser compatibility
The page previously asserted this feature shipped in Chrome 153 (and noted 150 in earlier tables). However, when queried on 2026-10-07, the authoritative ChromeStatus API record (feature 5108373464547328) lists status as Proposed with target desktop milestone 154 under Intent to Ship. Standard engine positions are recorded below:
| Engine / Browser | Status | Notes & Evidence |
|---|---|---|
| Chromium (Chrome & Edge) | Proposed / Target 154 | ChromeStatus 5108373464547328; Issue 418397278; Intent to Ship |
| Gecko (Firefox) | No signal | Mozilla standards-positions #1394 |
| WebKit (Safari) | No signal | WebKit standards-positions #653 |
| Developer signals | Strongly positive | CSSWG issue #1771 · WHATWG HTML issue #555 |
security and privacy
- Cross-origin dimension protection: Sizing an iframe to match child content naturally conveys the child content's height to the embedding page. The
<meta name="responsive-embedded-sizing">opt-in ensures child documents explicitly authorize this disclosure. - Origin restrictions: Embedded documents can restrict responsive sizing to specific allowed origins using the
content="allow-origins=..."attribute on the meta tag. - CSP frame-ancestors: Site operators can restrict embedding contexts using the
Content-Security-Policy: frame-ancestorsdirective, adding defense-in-depth against unauthorized embedders. - Fenced frames exclusion: Fenced frames are excluded from responsive iframe sizing to preserve strict cross-site privacy boundaries.