Resizing a div - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Resizing a div


I have created a webpage that contains a div with style attribute overflow:auto; This will make sure the div doesn't grow if the data gets too long, but data can still be read by using the scrollbars

I now want this div to get resized when the window resizes. I tried to do this using JavaScript, but I didn't get it to work. Can anyone tell me how to do this ? Do I have to use JavaScript, or is there another style attribute for this... ?

If the window gets larger the div also needs to grow with the window, and if the window gets smaller the div should also get smaller. I want to do this because I want all menus and buttonsetc. to stay in place even when the window resizes, but I may not use frames. The site should entirely be build useing div and span elements...

Hope someone can help me with this.
mailto:[email protected]
the Netherlands...

Sign In or Register to comment.