CSS CSS Layout Basics Page Layout with the Float Property Clearing and Containing Floats

Borislav Gerov
Borislav Gerov
3,071 Points

Clear fix is not working

Can you help me solve the problem please? Im doing everything fine but the header is still not covering up the nav bar :/ My code: .clearfix::after{ content: ""; display:table; clear:both; }

Steven Parker
Steven Parker
203,989 Points

That's not enough of the code to demonstrate the issue. To facilitate a complete analysis, make a snapshot of your workspace and post the link to it here.

4 Answers

Adam Vala
Adam Vala
9,300 Points

I had the same problem. I had a space after the two colons in .clearfix::after.

And in the case of OP, I think he didn't add clearfix class in HTML.

And yes please do check out the teachers note always. They could be sometimes more beneficial than the video. I said "Sometimes". XXOXOX

Ethan Zoller
Ethan Zoller
7,592 Points

Make sure you are adding the class clearfix inside your html.

Brittney Laffey
Brittney Laffey
14,740 Points

Your code shows 2 colons after ".clearfix". Try deleting one.

Steven Parker
Steven Parker
203,989 Points

:information_source: Two colons is the correct syntax for a pseudo-element, though most browsers will let you get away with just one.