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,119 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.