Re: Specifying height of Initial Containing Block?

ValerieGSharp wrote:
> 
> I want to create an element with the height and width of the viewport.

Cool: height: 100%; width: 100%. However, since height will relate to
the root element, which grows to fit the content, you need this:

html {position: fixed /* so our containing block is the viewport */}

body {position: absolute; /* We don't really want it fixed; that hack is
overridden by this one */
height: 100%; /* height: 100% is meaningless unless the height of the
containing block is known; by fixing the root element, it is therefore
known (the viewport) */
width: 100%}

> Am I right in thinking that the root element for an HTML document is the
> <html> tag?
> If so, how can one specify a height property for it, when according to
> HTML4.01 neither 'height' nor 'style' are valid attributes for it?

Irrelevant. CSS is not concerned with HTML attributes.

Received on Wednesday, 30 August 2000 08:03:46 UTC