CSS min-width property

Definition and Usage

min-width Sets the minimum width of the element.

Description

This property value sets a minimum limit on the width setting of the element. Therefore, the element can be wider than the specified value, but not narrower. Negative values are not allowed.

See Also:

CSS Tutorial:CSS Dimensions

CSS Reference Manual:CSS max-width property

HTML DOM Reference Manual:minWidth Property

Example

Set the minimum width of the paragraph:

p
  {
  min-width:100px;
  }

Try It Yourself

CSS Syntax

min-width: length|initial|inherit;

Property Value

Value Description
length Defines the minimum width value of the element. The default value depends on the browser.
% Defines the percentage minimum width based on the containing block-level object.
inherit Specifies that the value of the min-width property should be inherited from the parent element.

Technical Details

Default Value: none
Inheritance: no
Version: CSS2
JavaScript Syntax: object.style.minWidth="50px"

Try It Yourself Example

Set the minimum width of an element using pixel values
This example demonstrates how to set the minimum width of an element using pixel values.
Set the minimum width of an element using percentages
This example demonstrates how to set the minimum width of an element using percentage values.

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome IE / Edge Firefox Safari Opera
1.0 7.0 1.0 2.0.2 4.0