max-width, min-widthNN 6 IE n/a CSS 2

Inherited: No

These attributes let you establish a minimum and/or maximum width for an element. You can bracket the permissible width of an element regardless of the width caused by the natural flow of the content within a parent container.

 
CSS Syntax
 
max-width: length | percentage | none
min-width: length | percentage | none
 
Value

See the discussion of length values at the beginning of the chapter. The value may also be a percentage that is calculated relative to the element's container. A value of none removes all constraints, allowing the content to flow naturally.

 
Initial Value

none (max-width); none (min-width).

 
Applies To

All elements.

 
Object Model Reference
 
[window.]document.getElementById("elementID").style.minWidth
[window.]document.getElementById("elementID").style.maxWidth