English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the width attribute.
The width attribute of HTML specifies the width of <iframe> in pixels.
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.
<iframe width="pixels">
Value | Description |
---|---|
pixels | Width in pixels (for example "200px" or just "200"). |