May 04, 2021 HTML Reference Manual
3. Label definition and instructions for use
5. The difference between HTML 4.01 and HTML5
All major browsers support the hashtags.
The label specifies an inline framework.
One inline framework is used to embed another document in the current HTML document.
Tip: You can place the text you want between the slt; iframe and slt;/iframe sgt; so that you can handle browsers that don't support the slt; iframe.
Tip: Use CSS to define styles for slt;iframe,including scroll bars.
Tip: Tags are primarily used for common parts of multiple pages, such as navigation bars, ad columns, and so on.
HTML5 has added some new properties and removed some of the properties from HTML 4.01.
In XHTML, the name property is discarded and will be removed. Use the id property instead.
New : The new property in 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> 的名称。 |
sandbox New |
""
allow-forms allow-same-origin allow-scripts allow-top-navigation |
对 <iframe> 的内容定义一系列额外的限制。 |
scrolling |
yes
no auto |
HTML5 不支持。 规定是否在 <iframe> 中显示滚动条。 |
seamless New | seamless | 规定 <iframe> 看起来像是父文档中的一部分。 |
src | URL | 规定在 <iframe> 中显示的文档的 URL。 |
srcdoc New | HTML_code | 规定页面中的 HTML 内容显示在 <iframe> 中。 |
width | pixels | 规定 <iframe> 的宽度。 |
The label supports the global properties of HTML.
The tag supports the event properties of HTML.
HTML tutorial: HTML framework
HTML DOM Reference Manual: IFrame Object