HTML <img> height Attribute
Example
<img src="img-boy.jpg" alt="Boy" width="300" height="200">
Meaning
The height attribute specifies the height of an image.
Always specify height and width attributes for images.
Standard Syntax
HTML: <img src="URL" alt="text" height="height">,
XHTML: <img src="URL" alt="text" height="pixels" />
Advertisement
Attribute Values
| Value | Description |
|---|---|
| pixels | Specifies the height of the image. |
More Example
Example
<h1>Style Attribute Example</h1>
<img src="img-boy.jpg" alt="Boy" style="width: 300px;height: 150px;">
<h1>Width and Height Attribute Example</h1>
<img src="img-boy.jpg" alt="Boy" width="300px" height="150px">