How to use Height and Width attribute In HTML

The height and width attributes are used to specify the size of the iframe. The attribute values are specified in pixels by default. You can use pixels or percentages (e.g., “80%”).

Example : This example describes the HTML iframe Tag by setting the width & height of the iframe.

HTML
<!DOCTYPE html>
<html>

<body>
    <h2>HTML iframe Tag</h2>

    <p>
        Content goes here
    </p>

    <iframe src=
"https://media.w3wiki.org/wp-content/uploads/20240206111438/uni2.html"
            height="395" 
            width="400">
    </iframe>
</body>

</html>

Output:


HTML Iframes Example Output


HTML Iframes

HTML iframes offer a powerful way to embed external content, such as videos, maps, or other webpages, directly into your own webpage. This article provides an in-depth exploration of HTML iframes, their syntax, and how they can be used to enhance your web development projects.

Similar Reads

What are HTML Iframes?

An iframe is an HTML document embedded inside another HTML document. The