<img src="" width="" height="">
Browser |
|
---|---|
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
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
-
(width:193px, height:130px)
(width:96px, height:65px)
(width:100%, height:130px)