English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <iframe> width property

This article introduces the HTML iframe width property, which specifies the width of <iframe> in pixels. Online examples demonstrate how to use the HTML iframe width property, browser compatibility, syntax definition, and detailed information about its attribute values.

 HTML <iframe> tag

Online Example

specified height480-pixel, width of280-pixel<iframe>:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<iframe> width property - Basic Tutorial Website oldtoolbag.com</title>
<body>
<iframe src="/" width="480" height="280">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the width attribute.

Definition and Usage

The width attribute of HTML specifies the width of <iframe> in pixels.

HTML 4.01 and HTML5differences between

In HTML 4.01In, the width can be defined in pixels or as a percentage of the containing element. In HTML5In, this value must be specified in pixels.

Syntax

<iframe width="pixels">

Attribute Value

ValueDescription
pixelsWidth in pixels (for example "200px" or just "200").
 HTML <iframe> tag