Version: Level 1
Compability: IE4+ N6
| Length | Abbrev. |
|---|---|
| centimeters | cm |
| ems | em |
| inches | in |
| millimeters | mm |
| picas | pc |
| pixels | px |
| points | pt |
The height property allows you to set the height of an element of text or an image. This property is not inherited.
For example, you could embed an image into a specified position within a text using the float property. Then use the height and/or width properties to specify an exact size for the image. If you set the height of an element to a specified value and set the width property to auto, the element will be scaled proportionally (i.e., you maintain the aspect ratio).
img { height: 150mm; }
img { height: 2.85in; }
img { height: 45pc; }
img { height: 36pt; }
img { height: 50%; }
img { height: auto; }
img {
height: 3.0in
width: auto
}<img src="/images/guru.gif">
<br>
<img src="/images/guru.gif" style="height: 55px; width: auto;">
