Difference between revisions of "CSS GUIDE MAX-WIDTH"

From CDOT Wiki
Jump to: navigation, search
 
 
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
  
This property allows a maximum width to be set for an element box. The calculation for the element's width may be less than this value, but if the calculated 'width' value is above this value it will recompute the 'width' using the '''max-width''' value as the new 'width' value. If the value of 'min-width' is greater than the value of '''max-width'', the '''max-width''' property value becomes the [[CSS_GUIDE_MIN-WIDTH | min-width]] value.
+
This property allows a maximum width to be set for an element box. The calculation for the element's width may be less than this value, but if the calculated 'width' value is above this value it will recompute the 'width' using the '''max-width''' value as the new 'width' value. If the value of [[CSS_GUIDE_MIN-WIDTH | min-width]] is greater than the value of '''max-width''', the '''max-width''' property value becomes the [[CSS_GUIDE_MIN-WIDTH | min-width]] value.
  
 
== Syntax ==
 
== Syntax ==
Line 39: Line 39:
  
 
== See Also ==
 
== See Also ==
 +
 
[[CSS_GUIDE_MIN-WIDTH | min-width]]
 
[[CSS_GUIDE_MIN-WIDTH | min-width]]

Latest revision as of 19:37, 13 December 2006

Summary

This property allows a maximum width to be set for an element box. The calculation for the element's width may be less than this value, but if the calculated 'width' value is above this value it will recompute the 'width' using the max-width value as the new 'width' value. If the value of min-width is greater than the value of max-width, the max-width property value becomes the min-width value.

Syntax

h5 { max-width: length | percentage | none }

Legal Values

inherit

  • Explicitly sets the value of this property to that of the parent.

none

  • No limit is placed on the maximum allowable width for the element.

length

  • Refers to an absolute measurement for the maximum computed element box width. Negative values are not allowed.

percentage

  • Refers to a percentage of the width of the containing element block.

Mozilla Recommended Values

Usage Examples

Ext/Doc: h5 { max-width: 150px }
In-Line: <h5 STYLE="max-width: 150px">text</h5>

Notes

Specification Conformance

Browser Compatibility

See Also

min-width