CSS min-width Property


The min-width property sets the minimum width of an element. If the browser window in width becomes smaller than the specified minimum width of the element, then the width of the element remains unchanged, and a horizontal scroll bar appears in the window. The element width value will be calculated depending on the values ​​of the set properties width, max-width and min-width.

Initial value
Applies to
All elements except non-replaced inline elements and table elements
Computed value
The percentage as specified or the absolute length
JavaScript syntax

Interactive Demo

Change the minimum width.


min-width: [ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content


  • <length>Specifies a fixed width. Negative values are not allowed.
  • <percentage>A percentage relative to the width of the containing block. If the containing block has no width explicitly set then is is treated as none. Negative values are not allowed.
  • max-contentThe max-content width or height.
  • min-contentThe min-content width or height.
  • availableThe containing block width or height minus margin, border, and padding.
  • fit-contentIf the total available space is finite, equals to min(max-content, max(min-content, fill-available)). Otherwise, equal to the max-content measure. Requires CSS Intrinsic & Extrinsic Sizing Module support in browsers.


<div class="test">The block in which the minimum width is set to 100px.</div> 
<div class="test2">The block in which the minimum width is 100px and the maximum is 200px ..</div>
.test {
   min-width: 100px;
   background: khaki; 
.test2 {
   min-width: 100px;
   max-width: 200px;
   background: orange;

Browser Support

The following table will show you the current browser support for the CSS min-width property.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 2nd January 2024