Horje

How to add HTML <iframe> width Attribute

An <iframe> with a specified height and width of 200 pixels:

Definition and Usage

The width attribute specifies the width of an iframe, in pixels.

The default width is 300 pixels.

Browser Support

Syntax

<iframe width="pixels">

Attribute Values

Value Description
pixels The width in pixels (like "100px" or just "100")
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The iframe height attribute</h1>

<iframe src="https://horje.com/" width="200" height="200">
</iframe>

</body>
</html>

Output should be:

How to add HTML <iframe> width Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin