[WEB4LIB] height as a percentage of the body element in CSS

Kevin W Bishop bishopk at rpi.edu
Thu Oct 7 10:44:25 EDT 2004


-----Original Message----- 
Subject: [WEB4LIB] height as a percentage of the body element in CSS

In CSS, when the height attribute of an element is expressed as a
percentage, the percentage in question is a percentage of the height of
the parent element. In many cases, the parent element will be the body
element.

Is the height of the body element the height of the viewport (or screen)
or is it the height of the document? A document may run to two or three
screens. Any testing I have done suggests it is the screen. It is easier
for me to manage if it is the screen but I haven't seen this written
down anywhere. 
******************************************************************* 

The viewport is the width and height of the screen space between the
bottom of the browser tools at the top, the scroll bar at the right, the
status bar at the bottom, and the edge of the browser on the left.  It
is not the screen per se, but the extent to which the browser is
stretched open to reveal the loaded document.  

Install the web developer's toolbar for your favorite Gecko browser and
use the "Resize" option; it should help with an understanding of size,
not to mention future development projects.  
http://extensionroom.mozdev.org/more-info/webdeveloper

When defined relatively, the height of the body element will be the
number of lines required to display the document.  This varies depending
on the size (i.e., width) of the viewport.  In fixed width designs, the
height of the document is also more likely to be fixed as well, by
default.    

Hope this helps.
-kb

___________________________
Kevin W. Bishop > bishopk at rpi.edu
Communication & Collaboration Technologies
Rensselaer Polytechnic Institute > http://www.rpi.edu/
  RPInfo: http://www.rpi.edu/rpinfo/




More information about the Web4lib mailing list