Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

CSS Error, need help

The two columns will not be contained in their 'container' parent. Does anyone know how to fix this?

Here is the CodePen:

http://cdpn.io/azGbt

2 Answers

Yes, you need a clearfix hack. A parent div will collapse where it only contains floated children.

Here is a good read on the clearfix http://css-tricks.com/snippets/css/clear-fix/

Basically, all you have to do is add this to your CSS

.group:after {
  content: "";
  display: table;
  clear: both;
}

And than add the class group to your main container div.

The same clearfix with a bit more supoprt: http://nicolasgallagher.com/micro-clearfix-hack/ and this is the clearfix that the bootstrap framework uses.

Thank you very much Kevin!

Thank you very much Kevin!