Content Overflow

paularm

New Member
Messages
13
Reaction score
0
Points
0
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?
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
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:

gptsven

New Member
Messages
253
Reaction score
5
Points
0
for the style of the division: put either this : min-height:400px; and delete : height:400px;
 

matthew88

New Member
Messages
9
Reaction score
1
Points
0
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
 
Top