MDN responsive iframe sizing examples

July 10, 2026 ยท View on GitHub

This set of examples demonstrates usage of the responsive iframe sizing features:

Examples

  • Basic example: Provides a basic example showing how the frame-sizing CSS property and responsive-embedded-sizing meta 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 the requestResize() method can be used to dynamically resize an <iframe> element to continue to neatly contain its embedded content, when the content size changes. See the requestResize() demo live.