Introduction to Iframes
Iframes, or inline frames, allow you to load separate HTML files into an existing document. Iframes can be placed anywhere in the document flow. See an example iframe.
Validation: Documents containing iframes will validate with an HTML5 doctype. The iframe element is not valid in strict XHTML or strict HTML4, but will validate with a transitional XHTML or HTML4 doctype declaration. Some of the attributes that are valid in HTML4 are not valid in HTML5, for example, frameborder and scrolling.
Iframe Document Styles: The document loaded into the iframe does not inherit styles from the containing document. Styles to be applied to iframe content need to be included in that document.
_parent to replace the containing document. See an example.
Find out about the iframe onload event and other iframes topics from the list on the right.
- See W3 Schools for information about iframe attributes for both HTML4 and HTML5. ^
- HTML5 introduces a
seamlessattribute that will enable style inheritance, but browsers do not yet support it.^