by
Lessons:15Length:1.7 hours

3.2 Responsive iFrames Without Reflow

It’s very common to use iFrames to load content like YouTube videos, maps, code examples, and so on. When using AMP’s custom amp-iframe element, such content is responsive, maintains its aspect ratio, and prevents page reflow. In this lesson we’ll achieve the same thing with our own iFrames via the addition of a div and a few lines of CSS.