Version: No
| Length | Abbrev. |
|---|---|
| centimeters | cm |
| ems | em |
| inches | in |
| millimeters | mm |
| picas | pc |
| pixels | px |
| points | pt |
The width property allows you to set the width 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 width and/or height properties to specify an exact size for the image. If you set the width of an element to a specified value and set the height property to auto, the element will be scaled proportionally (i.e., you maintain the aspect ratio).
img { width: 150mm; }
img { width: 2.85in; }
img { width: 45pc; }
img { width: 36pt; }
img { width: 140%; }
img { width: auto; }
img {
width: 3.0in
height: auto
}<img src="/images/guru.gif">
<br>
<img src="/images/guru.gif" style="width: 55px; height: auto;">
