width
Sets the width of an element. It can be defined in absolute units like pixels or relative units like percentages.
Quick example
.container {
width: 100%;
max-width: 1200px;
/* responsive width was a max limit */
}Quick facts
Initial value
autoInherited
No
Applies to
all elements but non-replaced and table rows
Animation type
lpc
Values
autolength-percentagemin-contentmax-contentfit-contentcalc-sizeanchor-sizewidth Browser Support
Widely availableSince 201596% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
Safe to use without fallbacks.
1+
1+
1+
12+