What's new? | Help | Directory | Sign in
Google
             
Search
for
Updated Sep 19, 2008 by pilgrim
Labels: about-html, is-html-attribute, from-w3c
ImgWidthAttribute  
The img width attribute specifies the width of an image.

You are here: Home > HTML Reference > Elements > <img> element > width attribute

Usage

See <img> for usage information and examples.

Values

The width attribute specifies the width in pixels, and as such it must be a positive integer, or 0. Unlike widths in CSS, this attribute must NOT include the "px" unit of measure. The width attribute is always understood in pixels.

Elements

You can use the width attribute on the following elements:

Browser compatibility

Compatibility table legend

Test IE8 IE7 IE6 FF3 FF2 Saf3 Op9 Chrome
img.width reflects <img width="42"> Y Y Y N Y Y Y Y

Further reading


Sign in to add a comment