Text reaches beyond div. How to make div expand

Permalink
Hey guys,

i have this problem, when my text gets long, it reaches beyond the div, it was assigned to. How do i make the div expand (height-wise) with the text. So the div follows the text :-)

You can see it here:http://hos.lund-co.dk/ydelser/test-og-analyse/...


//Anders J.

View Replies: View Best Answer
Steevb replied on at Permalink Reply
Steevb
Hi,
Don't give the div a height setting?

Hope that helps

Steev
Ihateit replied on at Permalink Reply
Thanks for the fast reply :-)

If i don't give the div a height setting it just collapses into nothing. I've also tried with min-height, but it's the same problem where the div doesn't expand according to the text.

//Anders J.
Steevb replied on at Permalink Reply
Steevb
Hi,

Try 'overflow: auto' or 'overflow: hidden', that might help.
Ihateit replied on at Permalink Reply
'auto' makes scroll bars in both bottom and side, and is not wanted. 'hidden' hides all text that would else expand beyond the div.
Thanks for the suggestions :-)

//Anders J.
Steevb replied on at Permalink Reply
Steevb
Hi,

Your template and css are bit messy.

Taking height out of
<div id="us-content-row2">
should work?

Your page title is duplicated and the character set is shown three times?

You need to look at your template structure and check the css.

If you need help let me know.

Steev
Ihateit replied on at Permalink Best Answer Reply
Hey Steev,

thanks very much for your help. I figured it out, with help from your inputs. Apparently floating items will expand beyond the div, so i removed the height as you said, and also all float attributes.

Thank you so much for taking the time to help me :-)

//Anders J.

Solution: Remove height and float
terano replied on at Permalink Reply
terano
Hi,

I came to this discussion trying to solve the same problem. In my case it was sufficient to add a clear-div below the content (which has a variable height and consists of serveral floating divs; I still have some min-heights specified). So, put a clear-div below all the content-divs (those can still be floating) but still inside the wrapper of your content:

<div id="clear"> </div>


css:
#clear {
   clear: both;
}
mhawke replied on at Permalink Reply
mhawke
Don't use an id for this because id's are unique which means there is only supposed to be one of them on the page. There will be times when you want to use this more than once on a page. Use a class instead:

css:
.clear {
clear:both;
}


html:
<div class="clear"></div>
terano replied on at Permalink Reply
terano
yeah, I agree, a class is better than a div for this purpose. thanks for the additional remark.