Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Dynamically Setting Div Height

Want to fill client area exactly

6:24 pm on Jan 19, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:July 30, 2004
votes: 0

I'm using a very popular Map homepage as an example of what I'd like to do.

The page is set so that the client area of the browser is filled up precisely. The map is contained in a div element, and the height property is set inline on the style attribute of the div.

Resizing the window results in the height property being reset to exactly fill to the bottom of the page, so that there is no need to display a scroll bar.

How can this be done, including before the page is first displayed?

Thanks in advance!

10:32 pm on Jan 29, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 11, 2006
votes: 0


Have you considered using CSS? You could set the div's position to absolute or relative and use the top, bottom, left, right properties [w3.org] to make it fill the viewport.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members