[thelist] setting height of a DIV to screen

Tom Dell'Aringa pixelmech at yahoo.com
Mon Jun 10 21:39:01 CDT 2002


I'm trying to set a "main" part of a layout to the height of the window (anal, I know.) It doesn't
have to be this way, but I'd like it to be. The thing I have been messing with is:

function setMainSize()
{
	var height = window.screen.availHeight;
	document.getElementById("main").style.height = height;
}

window.onload = setMainSize;

I realize this is not cross browser or anything, but I just want to get it to work first. This
gives me a height that is much more than I see in my window so I have to scroll. screen.height
gives me basically the same. These are both DOM level 0 so I thought they should work, but maybe
you can't set height in a div this way? CAN I set height correctly?

/pixelmech

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the thelist mailing list