[thelist] Table Alignment Problems

MRC webmaster at equilon-mrc.com
Wed Feb 27 10:51:00 CST 2002


Mark,

> > you _can_ set the height of a block element in CSS very
> > simply:
> >
> > div {
> >  height: 100% ;
> > }
[...]
> We're right in the middle of a discussion on this over at CSS Discuss,
where
> Eric Meyers' suggested solution is
>
> html, body {height:100%}
> div {height:100%}

    Actually, I'm involved in that discussion, and that suggestion was mine.
It's still being tested, however.
    But keep in mind that that is a slightly different topic: making an
element appear to span 100% of the height of the browser's window. That is
where the problem comes in (primarily in Netscape 6) because it's not clear
what the default height of the body or html elements are, and different
browsers interpret them differently.
    But if, say, you have a div with a height set to 300px which in turn
contains another div, that second div can be assigned a height of 100% and
will expand to fit the height of its container. One problem being: the W3C
box model places padding and borders _outside_ the dimensions of the block,
so if you add any padding or borders to the top or bottom of the contained
element, it will extend beyond the height of its container. That's one way
in which the traditional IE box model was more intuitive (padding and
borders were contained within the dimensions of the element).

James Aylard




More information about the thelist mailing list