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.

HTML How to Make a Website Responsive Web Design and Testing Build a Three Column Layout

Michael Rathbun
Michael Rathbun
1,624 Points

I'm not following what you mean by "clear". I get the concept behind the problem but not what "clear" means?

A shot in the dark here: Is "clear" describing a clearing of space for the column code to reset itself from that point ?

Sam Portillo
Sam Portillo
2,640 Points

Hi Michael,

When you are using the float property, elements will appear to be side-by-side. Clear allows you to reset a specific element such that it won't inherit the float property.

For example, if you are floating all elements in a body (which includes a footer element), but you want to have your footer element exempt from this inheritance, you can remove the float property from the footer element by styling the footer CSS in this way:

footer{ clear: both; }

Hope this makes a little more sense.

1 Answer

From the MDN docs for the clear property:

The clear CSS property specifies whether an element can be next to floating elements that precede it or must be moved down (cleared) below them.