Set the minimum width of a <div> element:
The minWidth property sets or returns the minimum width of an element.
The minWidth property has effect only on block-level elements or on elements with absolute or fixed position.
Tip: To set or return the maximum width of an element, use the maxWidth property.
The minWidth property is supported in all major browsers.
Return the minWidth property:
Set the minWidth property:
Value | Description |
---|---|
length | Defines the minimum width in length units. Default is 0 |
% | Defines the minimum width in % of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | 0 |
---|---|
Return Value: | A String, representing the minimum width of an element |
CSS Version | CSS2 |
Return the minimum width of a <p> element:
CSS tutorial: CSS Dimension
CSS reference: min-width property