Well I seem to have the problem that when I add too much text into the main content of my website the div doesn't adjust it's height to incorporate it. Instead the text just overflows into and beyond the footer.
Anyone know how to stop this?
Well I seem to have the problem that when I add too much text into the main content of my website the div doesn't adjust it's height to incorporate it. Instead the text just overflows into and beyond the footer.
Anyone know how to stop this?
You explained the behavior you get, but not the behavior you want and neglected to post a minimal test case and a live link. What do you want to happen rather than overflow? The div to fit the content? A scrollbar?
My best guess as to what's wrong is the text is within an absolutely positioned or floated element (which aren't taken into account when calculating the height ([2]) of a parent), in which case the solution is not to absolutely position the element (and find an alternative), or auto-clear the float, or set overflow to "auto" or "scroll" so the height of the div stays the same. Without seeing sample source code (and please don't dump the entire page source), it's impossible to say what's going wrong and offer solutions.
Last edited by misson; 12-27-2009 at 01:31 AM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
for the style of the division: put either this : min-height:400px; and delete : height:400px;
You should of posted your DIV code.
I think the problem with ur DIV overflow is self created by forcing the height value of the DIV forcing the overflow outside of the DIV.
A great way to handle over flow is add a CSS overflow code
<div style="overflow: scroll;">
You can check out the other overflow options for ur DIV at the fellowing link.
http://www.w3schools.com/Css/pr_pos_overflow.asp
Thanks gptsven that worked.