The Height Property


The height property sets the height of the element. As with the width property, the height property is seldom used with block-level elements, and its use in those cases may lead to some complications. This property is used most often with images.

Name:

height

Value:

<length> | auto

Initial:

auto

Applies to:

block-level and replaced elements

Inherited:

no

Percentages:

N/A


This property has two values:

  • Length An absolute or relative value.

  • auto This is the default.

Usually, you won't set the height of a block element explicitly; you set only the margins and padding. By default, the height has the value auto. The height is determined simply by how much room is needed to display the number of lines in the element.

Explicitly setting the height is even rarer than specifying the width. If you do and the text needs more space to display than you have allotted, a scroll bar or similar device may be introduced into the element by the browser so that the user can get to the text that is out of sight. If the height is more than that needed by the text in the element, the extra space is treated as padding.



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net