Post

Until now, embeds with changing heights, like comment widgets or social posts, meant measuring the content, sending the size to the parent page with postMessage(), and resizing the iframe by hand.

Now the embedding page sets frame-sizing: content-height in CSS, and the embedded document opts in with <meta name="responsive-embedded-sizing">. For cross-origin embeds, allow-origins controls which sites can use the content size.

For now this works only in Chrome and isn't Baseline yet. Also watch out for layout shifts that can hurt CLS. With @supports, you can keep your current approach as a fallback and adopt this step by step. Details and a demo: developer.chrome.com/blog/respons...

developer.chrome.comResponsive iframes in Chrome 154  |  Blog  |  Chrome for DevelopersChrome 154 adds support for responsively-sized iframes, letting an iframe size itself based on the intrinsic size of its embedded document.

No replies yet.