Easy Tutorial
❮ Prop Tabledata Abbr Dom Obj Select ❯

Style minWidth Property


Definition and Usage

The minWidth property sets or returns the minimum width of an element.

The minWidth property only works on block-level elements or elements with absolute/fixed positioning.

Syntax

Setting the minWidth property:

Returning the minWidth property:

Value Description
length Defines the minimum width using units like px, cm, etc. The default is 0.
% Defines the minimum width as a percentage of the parent element.
inherit The value of the minWidth property is inherited from the parent element.

Browser Support

All major browsers support the minWidth property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 only supports "inherit" if the !DOCTYPE is specified. IE9 supports "inherit".


Example

Setting the minimum width of an element:

❮ Prop Tabledata Abbr Dom Obj Select ❯