Sébastien Rigaux

Chrome: auto-sizing iframes to their content with CSS

View resource

alfy.blog

Chrome 154 introduces the frame-sizing: content-height CSS property, letting iframes automatically match their content’s height without scripts or message passing. This requires the embedded page to opt in with a meta tag and explicitly allow the parent domain, so adoption depends on both sides cooperating. The article details practical use cases (payments, widgets, dynamic forms), compatibility constraints, and best practices to avoid information leaks or layout shifts.

Article illustration: auto-sizing iframes in Chrome with CSS