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 Layout Techniques Float Layout Float Layout Challenge

clearfix

im not her how to make a clearfix

2 Answers

.main-logo, .main-nav li { float: left; }

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

Erik McClintock
Erik McClintock
45,783 Points

Joshua,

For this task (task 2 of 4) in this challenge, rather than creating an entirely new clearfix element from scratch, they simply want you to apply a class that is already set up in your CSS to achieve the clearfix goal to a pre-existing element.

If you look in your CSS file in the challenge, you'll see the class ".group" at the bottom of the file, with properties inside that make that class apply a clearfix to any element that it's attached to. In your HTML file, you'll find an element with the class "main-header", which is the element that this challenge wants you to turn into a clearfix. So, to do that, you need to add the "group" class to that element that has the "main-header" class, and you're good to go!

Erik

I'm sorry but i tried and its not working

Erik McClintock
Erik McClintock
45,783 Points

Will you post the new code that you've tried so that I can help show you where you might've gone wrong?

Erik

Erik McClintock
Erik McClintock
45,783 Points

Joshua,

The edit you need to make for that task of this challenge is in the HTML file, not the CSS file. In your HTML, find the element with a class of "main-header", and add the class "group" to it as well. That will apply the styles that are already laid out for the "group" class; you don't need to alter any styles for this particular task.

Does that make sense?

Erik