Html5教程 专题
专题目录
您的位置:html > Html5教程专题 > HTML5 <iframe> 标签
HTML5 <iframe> 标签
作者:--    发布时间:2019-11-20

使用html5 <iframe>标签来标记一个内联框架:

<iframe  class="lazy" data-original="http://www.w3cschool.cn"></iframe>
尝试一下 »

浏览器支持

internet explorerfirefoxoperagoogle chromesafari

所有主流浏览器都支持 <iframe> 标签。


标签定义及使用说明

<iframe> 标签规定一个内联框架。

一个内联框架被用来在当前 html 文档中嵌入另一个文档。


提示和注释

提示:您可以把需要的文本放置在 <iframe> 和 </iframe> 之间,这样就可以应对不支持 <iframe> 的浏览器。

提示:使用 css 为 <iframe> (包括滚动条)定义样式。


html 4.01 与 html5之间的差异

html5 新增了一些新的属性,同时去掉了 html 4.01 中的一些属性。


html 与 xhtml 之间的差异

在 xhtml 中,name 属性已被废弃,并将被去掉。请使用 id 属性代替。


属性

new :html5 中的新属性。

属性 描述
align (已废弃) left
right
top
middle
bottom
html5 不支持。html 4.01 已废弃。 规定如何根据周围的元素来对齐 <iframe>。
frameborder 1
0
html5 不支持。规定是否显示 <iframe> 周围的边框。
height pixels 规定 <iframe> 的高度。
longdesc url html5 不支持。规定一个页面,该页面包含了有关 <iframe> 的较长描述。
marginheight pixels html5 不支持。规定 <iframe> 的顶部和底部的边距。
marginwidth pixels html5 不支持。规定 <iframe> 的左侧和右侧的边距。
name name 规定 <iframe> 的名称。
sandboxnew ""
allow-forms
allow-same-origin
allow-scripts
allow-top-navigation
对 <iframe> 的内容定义一系列额外的限制。
scrolling yes
no
auto
html5 不支持。规定是否在 <iframe> 中显示滚动条。
seamlessnew seamless 规定 <iframe> 看起来像是父文档中的一部分。
src url 规定在 <iframe> 中显示的文档的 url。
srcdocnew html_code 规定页面中的 html 内容显示在 <iframe> 中。
width pixels 规定 <iframe> 的宽度。


全局属性

<iframe> 标签支持 html 的全局属性


事件属性

<iframe> 标签支持 html 的事件属性


相关文章

html 教程:html 框架

html dom 参考手册:iframe 对象

网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册