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

does anyone know why my clearfix isn't working?

I cant figure out my my clear fix isn't working, I floated the nav ul with a class of main-nav to the right and the header collapsed a bit.

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

My clearfix is right above the footer styling in the css https://jsfiddle.net/8nuhyz3p/

2 Answers

Did you add the class clearfix to your html document?

It took me about an hour to spot it... The syntax is wrong.

Try replacing this:

content='';

With this:

content: '';

One other thing... You only need to apply .clearfix to the parent container. So keep it in your <header>, but you can safely remove it from your <nav>.