HomeMathComputingArtsWordsLiteratureMusictwitter facebook webfeed

HTML Iframe Tutorial

Advertise Here For Profit

Xah Lee, 2009-01, …, 2011-06-30

This page is a tutorial on html “iframe” tag. “Iframe” can be used to embed another page's content in the current page, and it can also be used for a scrollable window inside a window.

If you are using HTML 4.01 transitional or XHTML 1.1 transitional, you can use “iframe”, like this:

<iframe src="some.html"
longdesc="iframe_longdesc.html" width="200" height="200"
align="top" frameborder="1" scrolling="auto">
For browsers that doesn't support iframe, this content is displayed.
</iframe>
AttributesValues
SRCsource url
NAMEa name string for the frame
LONGDESCa url
WIDTHpixels
HEIGHTpixels
ALIGNOne of: top, middle, bottom, left, right
FRAMEBORDER1 or 0
MARGINWIDTHpixels
MARGINHEIGHTpixels
SCROLLINGyes, no, auto

HTML 4.01 Strict

“Iframe” tag is not supported in HTML 4.01 Strict nor XHTML 1.1 Strict, but all browsers supports it anyway. To be absolutely correct, you can use “object” tag. See: HTML: using “Object” tag for “Iframe”.

“iframe” IS supported in html5. See: HTML5 Tags.

References

blog comments powered by Disqus