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

HTML Accessibility Websites CSS: Part 3

Peter Zee
Peter Zee
12,417 Points

Clear floats

Why is there no clear: both; after the navigation area?

I just learned in CSS Basics that this is needed because the logo and the navigation have been taken out of the normal flow of the page.

Best Regards,

Peter

Ryan Thoms
Ryan Thoms
6,952 Points

Hey Peter, I'm not sure I understand your question. Are you asking why clear is not being used for the navigation bar?

1 Answer

rydavim
rydavim
18,813 Points

I haven't done this particular course, so I'm not sure why he chose to do the layout this way.

The reason you don't need to clear the floats is because every major element is floated. In this way, they all float around each other - so you don't really have anything in the normal document flow that would require clearing floats to behave correctly.

Let me know if that isn't clear, or if you have any follow up questions. Happy coding! :)

Peter Zee
Peter Zee
12,417 Points

Good morning,

Thank you; I understand now! :-) I also read somewhere else about floats to understand it better. This was the first time I have seen someone using floats without a clearfix. Well, learned something new again, which is good!

Greetings from Peter