MDN responsive iframe sizing examples
July 10, 2026 ยท View on GitHub
This set of examples demonstrates usage of the responsive iframe sizing features:
- The CSS
frame-sizingproperty - The
Window.requestResize()method - The
<meta name="responsive-embedded-sizing">meta tag
Examples
- Basic example: Provides a basic example showing how the
frame-sizingCSS property andresponsive-embedded-sizingmeta tag can be used to size an<iframe>to neatly contain its embedded content. See the basic demo live. requestResize()example: Builds on the previous example, showing how therequestResize()method can be used to dynamically resize an<iframe>element to continue to neatly contain its embedded content, when the content size changes. See therequestResize()demo live.