HTML <iframe> heightAttributes

HTML iframe 标签参考手册HTML <iframe> Tag

Examples

Specify an <iframe> with a height and width of 200 pixels:

<iframe src="http://www.w3cschool.cc/" width="200" height="200">
</iframe>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the height attribute.


Definition and Usage

The height attribute specifies the height of the <iframe>, in pixels.


Differences between HTML 4.01 and HTML5

In HTML 4.01, the height should be defined in pixels or as a percentage of the containing element. In HTML5, the height value must be in pixels.


Syntax

<iframe height="pixels">

Attribute Values

Value Description
pixels The height of the inline frame in pixels (e.g., "100px").


HTML iframe 标签参考手册HTML <iframe> Tag Other Extensions