height (HTML attribute)

Spec
Depr. Version
No HTML 4.01
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

height="height of window in pixels or percentage"

Description

As the iframe is ‘free-floating’, and not governed by the height or width of the parent window (as normal frames inside a frameset are), you need to let the browser know how high it should be on the page (if no height is specified, the browser will apply of around 150 pixels). Note that you can also use CSS to set the height of the iframe, which is the preferred method for styling this element.

Example

The iframe's height set to 200 pixels

<iframe src="iframe-content.html" height="200"
width="200" frameborder="1">
<p>Your browser does not support iframes.
That kinda sucks, eh?</p>
</iframe>

Value

A number representing the height of the iframe in pixels or a percentage.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

Every browser listed supports this attribute.

User-contributed notes

There are no comments yet.

Related Products