Reputation: 19591
I have a parent div inside which I have multiple divs which are children of parent div, But I don't get that why those child divs are overflowing outside the parent div,
I want parent div to adjust it's height according to the number of child divs inside it.
Heres the fiddle
Upvotes: 0
Views: 94
Reputation: 1599
overflow: hidden
will make the overflowing child content simply hidden, which, I believe, is not what you are trying to achieve.
To expand the parent div to show all child content, either specify overflow: auto
on the parent (may have side effects in some browsers), or put
<div style="clear: both"></div>
as the last child in your parent div.
Upvotes: 0
Reputation: 17930
Either float #downloads left, or use overflow:hidden
:
#downloads
{
background-color: #EEEEEE;
border: 1px solid #CCCDCF;
padding: 5px;
line-height: 25px;
overflow:hidden;
}
or:
#downloads
{
background-color: #EEEEEE;
border: 1px solid #CCCDCF;
padding: 5px;
line-height: 25px;
float: left;
}
Upvotes: 1