Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

child div goes outside parent div

Currently I am designing a website using CSS and HTML etc. But I have faced a problem there : my child div goes outside the parent div when I add floating to the child. The site resides here my web design

like image 934
Suraj Hazarika Avatar asked Dec 08 '12 11:12

Suraj Hazarika


2 Answers

Be more specific. Where is the problem on the website?

Try to add this to css, so parent will know about the size of the child element:

#parent{
   overflow:hidden;
}
like image 76
marinbgd Avatar answered Oct 01 '22 09:10

marinbgd


You need to clear after your float.

Try adding this css:

CSS

.container:after {
    content: "";
    display: table;
    clear: both;
}
like image 44
3dgoo Avatar answered Oct 01 '22 10:10

3dgoo