[thelist] JS/DOM: height or bottom of a div?

Peter-Paul Koch gassinaumasis at hotmail.com
Sun Aug 26 16:27:48 CDT 2001


>I'm using CSS positioning for my site, and I want the footer div to sit 
>below the content div. Since the content div will always be changing  
>sizes, I'm trying to get at it's height, or it's bottom, so that I can 
>calculate where to put my footer.
>
>Reading the DOM 1 spec, I see that the only attribute that DIV has is 
>ALIGN. Bummer. Can someone suggest a manner in which I can find out where 
>the bottom of a given div is?

Height of a DIV:

W3C DOM:
document.getElementById('DIVname').offsetHeight;
Microsoft DOM:
document.all['DIVname'].offsetHeight;
Old Netscape DOM:
document.layers['DIVname'].document.height

Hope this helps,

ppk

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





More information about the thelist mailing list