HTML <iframe> widthAttributes

HTML iframe 标签参考手册HTML <iframe> Tag

Examples

Specify an <iframe> with a height and width of 200 pixels:

<iframe src="http://www.w3cschool.cc/" width="200" height="200"></iframe>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the width attribute.


Definition and Usage

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


Differences between HTML 4.01 and HTML5

In HTML 4.01, the width should be defined in pixels or as a percentage of the containing element. In HTML5, the width value must be in pixels.


Syntax

<iframe width="pixels">

Attribute Values

Value Description
pixels The width in pixels (e.g., "100px" or just "100").


HTML iframe 标签参考手册HTML <iframe> Tag Other Extensions