0

How do you make a div expand or collapse to fit the amount of content in it? For example, we have this page which has too much space at the bottom when you first enter, then when you click an option it has too little. http://www.ealantamagazine.com/directory/webmaster-submit-website-free.html (Please excuse any oddities in the wording of the page; we've uploaded the script but haven't fixed all the text.) I read before that you can't change div height like that, but I'm pretty sure I've seen websites do it.

Edited by bwallace: n/a

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by bwallace
0

You need to position all your divs relatively to each other, and have the main div (I believe it was called div2) 'height: auto;', that should work...

0

Thanks! I needed to do a lot to clean up the style sheet, but I think what really fixed it was:

- float div2 left (it contains two divs, one floated left and the other floated right)
- set "min-height: 100%" for div2
- set "clear: both" for div3

We haven't yet fixed the page I mentioned in the original post, but the home page of the site and some others.

Edited by bwallace: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.