Visit Mozilla.org

CSS:min-width

From MDC

« CSS Reference

[edit] Summary

The min-width property is used to set the minimum width of a given element. It prevents the used value of the width property from becoming smaller than the value specified for min-width.

[edit] Syntax

min-width: <length> | <percentage> | -moz-max-content | -moz-min-content | -moz-fit-content | -moz-available

[edit] Values

  • length : can be in px, cm, in
  • percentage : % specified as a percentage of containing block's width
  • -moz-max-content : the intrinsic preferred width New in Firefox 3
  • -moz-min-content : the intrinsic minimum width New in Firefox 3
  • -moz-available : the containing block width minus horizontal margin, border, and padding New in Firefox 3
  • -moz-fit-content : the same as -moz-min-content New in Firefox 3

[edit] Examples

View Live Examples

table{min-width: 75%;}

form{min-width: 0;}

[edit] Notes

min-width overrides both max-width and width.


[edit] Specifications

[edit] Browser compatibility

Browser Lowest Version
Internet Explorer 6
Netscape 6
Opera 3.5

[edit] See also

box model, min-height, -moz-box-sizing, width, max-width