Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS height definition

Browser support
IEFFOpSaf

Type:

Syntax

height: <length> | auto

Description

The height property specifies the height of an element.

Values Description
auto Default. The browser calculates the height of the element.
percentage Defines the height in percentage of the parent element's height.
height<unit> Defines the exact height of the element. For example: 5px. The unit can be any of px (pixels), mm (millimeters), cm(centimeters), in (inches), pt (points), pc (picas), em (the element's font height) or ex (the element's x-height).

 

Example

[Try this example yourself]
<style type="text/css">
img.auto
{
height: auto
}

img.big 
{
height: 250px
}

img.small 
{
height: 60px
}
</style>

<img class="auto" src="http://www.glubase.com/images/glubase2.gif" />
<br />
<img class="big" src="http://www.glubase.com/images/glubase2.gif" />
<br />
<img class="small" src="http://www.glubase.com/images/glubase2.gif" />

Output



  • Comments

No comments added.