Back to CSS1 Reference | CSS1 Properties
Prev white-space | Next word-spacing
- Property
- width
- Values
- <length>, <percentage>, auto
- Initial
- auto
- Inherited
- no
This property can be applied to text elements, but it is most useful with replaced elements such as images. The width is to be enforced by scaling the image if necessary. When scaling, the aspect ratio of the image is preserved if the 'height' property is 'auto'.
Example:
IMG.icon { width: 100px }
If the 'width' and 'height' of a replaced element are both 'auto', these properties will be set to the intrinsic dimensions of the element.
Negative values are not allowed.