HTML <iframe> height Attribute

Last Updated : 27 May, 2026

The height attribute is used to specify the height of an <iframe> element. It helps control the vertical size of the embedded frame on a webpage.

  • Defines the height of the <iframe> in pixels.
  • Controls the vertical display area of embedded content.
  • Commonly used with the width attribute for proper frame dimensions.

Syntax: 

<iframe height="pixels">

Attribute Values: It contains single value pixel which specifies the height of the iframes in terms of pixels. 

html
<!DOCTYPE html>
<html> 

<head>
    <title>
        HTML iframe height Attribute
    </title>
</head>

<body style="text-align:center;"> 
    <h1>GeeksforGeeks</h1>
    
    <h2>
        HTML iframe height Attribute
    </h2>
    
    <iframe src="https://media.geeksforgeeks.org/wp-content/uploads/20210910170539/gfg-221x300.png"
            height="200" width="400"></iframe> 
</body> 
</html>                                    
Comment