HTML <iframe>标签用于创建嵌入式框架。
<!DOCTYPE html> <html> <head> <title>HTML iframe Tag</title> </head> <body> <iframe src="https://www.learnfk.com/index.htm" width="100%"></iframe> </body> </html>
这将产生以下结果-
此标签支持- HTML 中所述的所有全局属性。
HTML <iframe>标签还支持以下其他属性-
Attribute | Value | 描述 |
---|---|---|
align | left right top middle bottom |
指定如何根据周围的文本对齐iframe。 |
frameborder | 1 0 |
指定是否在边框周围显示边框。 |
height | pixels | 指定嵌入式框架的高度。 |
longdesc | URL | 框架内容的详细描述的URL。 |
marginheight | pixels | 允许您指定框架边框的左侧和右侧与框架内容之间的空间宽度。该值以像素为单位。例如,marginwidth =“ 10”。 |
marginwidth | pixels | 指定框架内容与左右边界之间的边界(以像素为单位)。 |
name | text | 框架名称 |
sandbox | "" allow-forms allow-same-origin allow-scripts allow-top-navigation |
为iframe中的内容启用一组额外的限制。 |
scrolling | yes no auto |
确定滚动条操作 |
seamless | seamless | 指定iframe应该看起来像是包含文档的一部分 |
src | URL | 框架内容文件的位置 |
srcdoc | HTML_code | 指定要在iframe中显示的页面的HTML内容 |
width | pixels | 指定嵌入式框架的宽度。 |
此标签支持- HTML 中所述的所有事件属性。
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)