CSS min-width Property

Set the minimum width of a <p> element:

p {
min-width: 150px;
}

Try it Yourself »


Definition and Usage

The min-width property is used to set the minimum width of an element.

This prevents the value of the width property from becoming smaller than min-width.

Note: The value of the min-width property overrides both max-width and width.

Default value: 0
Inherited: no
Animatable: yes, see individual propertiesRead about animatable – Try it
Version: CSS2
JavaScript syntax: object.style.minWidth=”400px” Try it
CSS Syntax
min-width: length|initial|inherit;
Property Values
Value Description
length Default value is 0. Defines the minimum width in px, cm, etc.
% Defines the minimum width in percent of the containing block
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Post Author: Zahid Farid