7.4 iframe Element

You’ve learned how to display an image in the body of a web page and also in the tab area at the top of the browser window. In this section, you learn to display an image in a frame that’s embedded within the browser window. Specifically, you’ll use an iframe (short for inline frame) element to create a browsing context. A browsing context is an area within a web page that can display an embedded web document, where a web document is something with a URL (i.e., a web page or a stored image).

Instead of loading an entire web page within an iframe’s browsing context, it’s more common to load a stored image into a browsing context. For example, in the Art Exhibit web page in FIGURE 7.4, an iframe element is used to display ...

Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.