width and height of an image

<img src="" width="" height="">

Internet Explorer Firefox Opera
Inline-block Empty

The width and height attributes of the IMG element specifies the width and height of an image.

<img src="example.gif" alt="Example" width="200" height="100">

Attribute Value Explanation
width=" " pixels or % the size of the width
height=" " pixels or % the size of the height
Tips and Notes

The data size of the image doesn't change even if the size is changed by this attribute.


Sample image
(width:193px, height:130px)

<p><img src="image/example.jpg" alt="Example" width="193" height="130"> (width:193px, height:130px)</p>

<p><img src="image/example.jpg" alt="Example" width="96" height="65"> (width:96px, height:65px)</p>

<p><img src="image/example.jpg" alt="Example" width="100%" height="130"> (width:100%, height:130px)</p>

Example (width:193px, height:130px)

Example (width:96px, height:65px)

Example (width:100%, height:130px)