What methods of ‘clearfix’ can I use?

I have the age-old problem of a div wrapping a two-column layout. My sidebar is floated, so my container div fails to wrap the content and sidebar. <div id=”container”> <div id=”content”></div> <div id=”sidebar”></div> </div> There seem to be numerous methods of fixing the clear bug in Firefox: <br clear=”all”/> overflow:auto overflow:hidden In my situation, the … Read more

How do you keep parents of floated elements from collapsing? [duplicate]

This question already has answers here: What methods of ‘clearfix’ can I use? (29 answers) Closed 7 years ago. Although elements like <div>s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: If floated elements have non-floated parent elements, the parent will collapse. For example: <div> … Read more