[thelist] Setting parent layer height to max. child layer height

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Aug 16 17:27:57 CDT 2001



>Do any of you DHTML gurus out there know how to set the height of a parent 
>layer to that of a child layer? For example, I have a parent layer 
>relatively positioned within a table cell. Within that parent layer are 
>several child layers of varying height, absolutely positioned one on top of 
>the other, with the height the layers not set (i.e., is based upon the 
>amount of text in the layer). Since parent layers don't inherit attributes 
>from child layers, I've got problems with text spilling outside of the 
>table cell when the amount of text in a child layer is more than a certain 
>amount.

Hmmmm...interesting problem. I think you have to use JavaScript

>Is there a cross-browser way to make the parent layer's height increase to 
>that of the tallest child layer?

You'd have to go through the child layers, take their offsetHeight and 
change the parent height to the largest offsetHeight you've found plus a bit 
more. This doesn't work in NN4, of course.

p[pk


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





More information about the thelist mailing list