Responsive iframes
Embedding third-party content (e.g., payment widgets, comment sections, social posts, live charts, embedded demos) is one of the most fundamental architecture patterns on the web.
However, <iframe> elements have historically been unable to automatically size themselves to the natural dimensions of their embedded documents without producing scrollbars or requiring brittle postMessage() polyfills .
Responsive Iframes (part of CSS Box Sizing Module Level 4) introduces a standardized, security-preserving mechanism for seamless frame sizing and consists of three parts:
- Embedding Opt-in: The parent document specifies
frame-sizing: content-height | content-width | content-block-size | content-inline-size | noneon the<iframe> - Embedded Opt-in: The embedded document includes
<meta name="responsive-embedded-sizing">to explicitly authorize sharing its layout intrinsic size - Dynamic Updates: The embedded document can trigger re-measurements via
window.requestResize()
Discussion on GitHub (0)
No comments on GitHub yet
Be the first developer to share technical feedback or use cases on this Interop proposal.
Join discussion on GitHub