Link to home
Start Free TrialLog in
Avatar of dh2oing
dh2oing

asked on

Resize div height to height of browser window (-) 50px

I need to resize the main div of my site so that it does not stop at the bottom of the content, but goes all the way down to the bottom of the window. I am currently using safari (i would like a cross-browser compatible solution).
Here is my css:

#main {
 position:relative;
 margin:0 auto;
 width:390px; height:100%;
 top:50px; bottom:0px;
 background-image:url(images/new_05.gif);
 background-repeat:repeat-y;
 padding-bottom:20px;
 min-height:380px;
}

I have tried several different ways of resizing through javascript to no avail( ie. document.getElementById('main').style.height = h; //h=document.height-50

Any ideas?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of softplus
softplus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dh2oing
dh2oing

ASKER

It is only a div, but yes you helped: I forgot the ="px"