Open In App

How to set height of an iframe element using HTML ?

Last Updated : 26 Nov, 2020
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

The iframe in HTML stands for Inline Frame. The "iframe" tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. An inline frame is used to embed another document within the current HTML document.

The HTML <iframe> height attribute is used to specify the height of the <iframe> in terms of pixels.

Syntax:

<iframe height="pixels">

Example:

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        How to specify the height of an
        iframe element using HTML?
    </title>
</head>

<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>

    <h2>
        How to specify the height of an
        iframe element using HTML?
    </h2>

    <iframe src=
"https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png"
            height="100" width="400">
      </iframe>
</body>

</html>

Output:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Similar Reads