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

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

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

Example

Example
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>

Output

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

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

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