width

Jump to: navigation, search

width


W3C Recommendation

Summary

Specifies the width of certain content elements in pixels.


Applies to HTMLImgElement

The width attribute specifies the visual width of img, iframe, embed, object, video, and input[type="image"] in pixels.

If a width attribute is set, but no height, the image will scale to preserve its original aspect ratio. If both the width and height are zero, the element should not be intended to be visible by the user.

Width values must be non-negative integers.

Examples

View live example

HTML

<img src="http://www.webplatform.org/logo/wplogo_transparent_xlg.png" height="100" width="150">




See also

Related articles

HTML
























  • width



























… further results

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]