Forum Moderators: not2easy

Message Too Old, No Replies

resizing a divlayer on window resize in ie

--

         

moiran

9:41 am on Aug 19, 2003 (gmt 0)

10+ Year Member



I've want a div-layer, containing text and a different background color, starting 200px from the top of the window and ending 10px from the bottom, no matter how much the user is resizing her/his window. In mozilla etc it's easy to comply by using:

.divstyle{
position:absolute;
width: 300px;
top: 200px;
bottom: 10px;}

this doesn't work in internet explorer though. how do I manage to get ie to resize the divlayer as the user resizes the browser window?

BlobFisk

9:53 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, moiran!

You could specify a div height of 100% with a top and bottom padding equal to the spaces you want there... You cannot use both the top and bottom attriubute together.

Another alternative would be to use a client side script to get the availHeight of the page and recalculate the height value of your layer dynamically.

HTH

moiran

10:07 am on Aug 19, 2003 (gmt 0)

10+ Year Member



Thank you.

Unfortunately, since the div has another background color than the surrounding, the padding-trick doesn't work. :( (actually, when I set the div height to 100%, in internet explorer the div layer becomes as high as the browser window no matter how much or little padding i define, it just moves downwards as much as the top padding defines...)

I guess it's time for me to finally learn some javascript... :)