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 trialIgor Fastovski
1,353 PointsWhy do we need 2 classes in the Clearfix?
I wonder why Guil needs another class (.grid-container:after) in the Clearfix? Looks like an unnecessary addition to me. Isn't just using the .group enough? If I was on my own, I would just use the existing .group like this: <div class="grid-container group"> Will this work?
1 Answer
Mat Linski
6,533 PointsGuil has explained it at the end of the video:
Finally, since we're floating our columns, we'll need this group Clearfix class to clear our floats. That way the grid container won't collapse. So, what we'll do is add a grid container after pseudo-element, to this Clearfix rule. THAT WAY IT'S ALREADY BUILT INTO OUR GRID. BUT WE COULD STILL USE THE GROUP CLASS SEPARATELY, IF WE NEEDED TO.
Igor Fastovski
1,353 PointsThank you Mat, it's clearer now. I've missed that bit from the video.
Igor Fastovski
1,353 PointsIgor Fastovski
1,353 PointsOoops I mean like this:
<div class="grid-container group">