width

Example

Initial value auto
Applies to all elements but non-replaced inline elements, table rows, and row groups

Syntax

  
width: 20em;
  

Values

Defines the width as an absolute value.
Defines the width as a percentage of the containing block's width.
The browser will calculate and select a width for the specified element.
The intrinsic preferred width.
The intrinsic minimum width.
Uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, )).

Browser support

width112143.51
animatable26121611156.1
fill46793312
fit-content467933311
fit-content_function
max-content4679664411
min-content4679663311
stretch22793156.1

We use cookies to improve your experience. Learn more in our Privacy policy.

×