html教程

定义和用法

<iframe> 标签创建包含另一个文档的行内框架。

HTML 4.01 与 HTML 5 之间的差异

HTML 5 中,仅仅支持 src 属性

 

例子

<iframe src="/index.html"></iframe>

 

属性

标准属性

class, contenteditable, contextmenu, dir, draggable, id, irrelevant,

lang, ref, registrationmark, tabindex, template, title

如需完整的描述,请访问 HTML 5 中标准属性。

事件属性

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu,

ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover,

ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup,

onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout,

onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload

如需完整的描述,请访问 HTML 5 中事件属性。


 实例,

内联框架,本例演示如何创建内联框架(HTML 页中的框架)。

<html> 
<body> 
<iframe src="/p/eg_planets.jpg"></iframe> 
<p>一些老的浏览器不支持 iframe。</p> 
<p>如果得不到支持,iframe 是不可见的。</p> 
</body> 
</html>