Internet Explorer for Windows versions up to and including 7 don??™t support the
value inherit.
The Ultimate CSS Reference 192
Safari??™s support for this property, when applied to positioned elements, is limited
to versions 2.0.2 or above.
max-height
max-height: { length | percentage | none |
inherit } ;
This property sets the maximum content
height of a block or a replaced element
(p. 175). This maximum height does not
include padding, borders, or
margins??”see The CSS Box Model
(p. 142).
An element that has max-height
applied will never be taller than the
value specified, even if the height
property is set to something larger. There is an exception to this rule, however: if
min-height is specified with a value that??™s greater than that of max-height, the
container??™s height will be the largest value, which, in this case, means that the
min-height value will in fact be the one that??™s applied.
Example
This style rule assigns a maximum height
of 100 pixels to paragraphs within the
element with ID "example":
#example p {
max-height: 100px;
}
max-height is usually used in conjunction with min-height to produce a height
range for the element concerned.
Pages:
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293