Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS max-height definition

Browser support
IEFFOpSaf

Type:

Syntax

max-height: <value>;

Description

The max-height property defines the maximum height of an element. If an element is higher than the specified max-height the next element will be displayed over the element.

Values

none | <length> | <percentage>

Version information

Available in CSS2

Example

[Try this example yourself]
<style type="text/css">
p.height
{
max-height: 12px
}
</style>

<p class="height">
  This text has a maximum height of 12 pixels.
  This text has a maximum height of 12 pixels.
  This text has a maximum height of 12 pixels.
  This text has a maximum height of 12 pixels.
  This text has a maximum height of 12 pixels.
  This text has a maximum height of 12 pixels.
</p>
<p>This text will be written on top of above text.</p>

Output

This text has a maximum height of 12 pixels. This text has a maximum height of 12 pixels. This text has a maximum height of 12 pixels. This text has a maximum height of 12 pixels. This text has a maximum height of 12 pixels. This text has a maximum height of 12 pixels.

This text will be written on top of above text.

  • Comments

No comments added.