Sent by Andrew Clover on 20 June 2002 08:08
Tuttle Grey [EMAIL-REMOVED]> wrote:
> the non-trivial question of just what height:100% means - i.e. 100% of
> what? Is it meant to be 100% of the viewport, 100% of the canvas, or
> 100% of something else?
In CSS2, it's "undefined". The spec says the height of the Initial
Containing Block (relative to which non-nested absolutely positioned
elements are placed) is decided by the browser, but does not define
exactly how it is defined. The situation is further complicated by an
inconsistency in the spec: section 9 says the ICB is the block
generated by the root element, whereas section 10 says the root element
is contained in the ICB.
This should, apparently, be cleared up for CSS 2.1 (a mooted revision to
be released sometime this year, hopefully). 2.1 will most likely fix the
ICB height to be the height of the viewport and say the root element is
contained in the ICB. (It will also have some helpful changes to
currently-annoying restrictions on when one can use percentage heights.)
Currently, though, browsers don't work quite like this. IE6/Win treats the
root element as the viewport, setting overflow properties on it for the
main scrollbar. IE5/Win treats the <body> element in the same way.
Konqueror makes the root element the ICB and makes its height the content
height of the document (including things that are not in the flow).
Setting:
body { height: 100%; margin: 0; padding: 0; }
makes %-height absolute children work in IE/Win, but does nothing for
Konqueror. I don't have a Mac to test it on but I don't believe it works
there; according to Tantek adding 'height: 100%' on <html> should make
it work on IE/Mac, but I'm not convinced this actually works from
previous experience. Anyone?
--
Andrew Clover
[EMAIL-REMOVED]
http://and.doxdesk.com/