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.
bwallace
0
Light Poster
Recommended Answers
Jump to PostYou 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...
Jump to PostSomething like this ?
http://www.pritaeas.net/public/jquery/partial-text/index.htmlThere's no reason to have to go to jQuery for something that can be done easily with CSS...
All 5 Replies
shaya4207
8
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
shaya4207
8
Junior Poster
pritaeas
commented:
My bad...
+7
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
bwallace
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.