Definition and Usage The height attribute specifies the height of the image. The height, and width attributes are set to let the browser kn...
Definition and Usage
The height attribute specifies the height of the image.The height, and width attributes are set to let the browser know how big the image is, so it can reserve space for the image in the page layout. If these attributes are not set, the site layout will change during loading (while the images load).
Note: Rescaling images is not good coding practice. Downsizing a large image to fit your site will use more bandwidth than necessary. It is better to manually rescale the image before using it in your website.
Syntax
<img height="length" /> |
Syntax Example
<img height="30" /> |
Attribute Values
Value | Description |
---|---|
pixels | Specify the height in pixels (like "100px", or just "100") |
percent | Specify height in percent of the containing element (like "20%") |