Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Alejandro Udinov
Alejandro Udinov
727 Points

How is header an parent element of floated .name & .main-nav elements ?

I dont' understand, how is <header> an parent element of floated .name & .main-nav elements, when infract they are contained in <div> .container ?? if at all div is the parent of these two elements ? so whats going on ?

1 Answer

Ivan Griessel
Ivan Griessel
6,438 Points

Main-header is more like an ancestor than a direct parent of .name and .main-nav in this situation, as far as I understand. At the end of the video he does apply the clearfix to .container and not to .main-header.