HTML img height Attribute
HTML <img> tag
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
Syntax Example
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%") |
Browser Support

The attribute is supported in all major browsers.
Example
Source |
Output |
<img src="demo_img.jpg"
alt="W3Schools example picture"
height="30" />
|
|
Note: As you can see in the example, if the height attribute
is set by itself (without setting the width attribute), the image will be
properly rescaled. However, if the width attribute is set, and the height
attribute is changed, the image will be stretched.
Try-It-Yourself Demos
img height
attribute example
Specify the height of an image.
HTML <img> tag
Learn how your website performs under various load conditions
 |
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|