TUTORIALReferencesFETCHED
HTML <iframe> height 属性
HTML <iframe> height 属性 HTML <iframe> 标签 实例 指定高度和宽度为 200 像素的 <iframe>: <iframe src='http://www.w3cschool.cc/' width='200' height='2..
Updated 7/16/2026
Tutorial detail pages default to noindex.
HTML <iframe> height 属性
实例
指定高度和宽度为 200 像素的 <iframe>:
<iframe src="http://www.w3cschool.cc/" width="200"
height="200">
</iframe>
</iframe>
尝试一下 »
浏览器支持
![]()
![]()
![]()
![]()
![]()
所有主流浏览器都支持 height 属性。
定义和用法
height 属性规定 <iframe> 的高度,以像素计。
HTML 4.01 与 HTML5之间的差异
在 HTML 4.01 中,高度应该被定义为以像素为单位或者以包含元素的百分比为单位。在 HTML5 中,高度值必须以像素为单位。
语法
<iframe height="pixels">
属性值
| 值 | 描述 |
|---|---|
| pixels | 以像素为单位的内联框架的高度(比如 "100px")。 |
HTML <iframe> 标签