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.
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.
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.
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.
Hi,
Try 'overflow: auto' or 'overflow: hidden', that might help.
Try 'overflow: auto' or 'overflow: hidden', that might help.
'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.
Thanks for the suggestions :-)
//Anders J.
Hi,
Your template and css are bit messy.
Taking height out of 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
Your template and css are bit messy.
Taking height out of
<div id="us-content-row2">
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
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
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
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:
css:
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; }
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:
html:
css:
.clear { clear:both; }
html:
<div class="clear"></div>
yeah, I agree, a class is better than a div for this purpose. thanks for the additional remark.
Don't give the div a height setting?
Hope that helps
Steev