English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <iframe> height attribute

This article introduces the HTML iframe height attribute to specify the height of the <iframe> in pixels, with an online example demonstrating how to use the HTML iframe height attribute, browser compatibility, syntax definition, and detailed information about its attribute values.

 HTML <iframe> tag

Online Example

Set iframe width to 450 pixels, height280 pixels:

<iframe src="https://www.oldtoolbag.com/" width="450" height="280"></iframe>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the height attribute.

Definition and Usage

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

HTML 4.01 and HTML5difference between

In HTML 4.01In HTML, the height can be defined in pixels or as a percentage of the containing element.5In the syntax, the value must be specified in pixels.

Syntax

<iframe height="pixels">

Attribute Value

ValueDescription
pixelsThe height of the inline frame in pixels (for example "100px
 HTML <iframe> tag