HTML and CSS Reference
In-Depth Information
Example
p {margin-height: 3em;}
.tight {margin-height: 0;}
#spec {margin-height: 15px;}
Compatibility
CSS 1, 2, 3 IE 4+ (buggy), 5+ Netscape 4+ (buggy), 6+, Firefox 1+ Opera 4+, Safari 1+
Note
• Elements may have default margins on them, and these values may vary by user
agent. Because of this inconsistency, many developers prefer to clear all margins
with a wildcard rule like * {margin: 0;} and build up individual values.
max-height
This property defines the maximum height a region may expand to if it is relatively sized.
Syntax
max-height: length | percentage | inherit
where the value of length is generally a measurement using a fixed value (for example, 100px ).
Percentages also may be used for relative layouts. A value of inherit indicates that the
value should be derived from an enclosing parent's value.
Examples
#div1 {width: 50%; max-width: 800px; min-width: 400px;
height: 50%; max-height: 1000px;}
#div2 {height: 100%; max-height: 1200px;}
Compatibility
CSS 2, 3 IE 7+ Netscape 6+, Firefox 1+ Opera 7+, Safari 1+
max-width
This property defines the maximum width a region may expand to if it is relatively sized.
Syntax
max-width: length | percentage | inherit
where the value of length is generally a measurement using a fixed value (for example,
100px ). Percentages also may be used for relative layouts. A value of inherit indicates
that the value should be derived from an enclosing parent's value.
Examples
#div1 {width: 50%; max-width: 800px; min-width: 400px;}
#div2 {width: 80%; max-width: 500px;}
Search WWH ::




Custom Search