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

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

Sanjeev Veloo
Sanjeev Veloo
1,430 Points

clear: left VS clear: both?

What is the difference between clear:left and clear: both in this scenario? i tried doing them and the both seem to accomplish the same things...

3 Answers

Yulia Markina
Yulia Markina
12,616 Points

Hi Sanjeev! The difference becomes crucial when you have float: left and float: right applied to elements in your document and you need to apply clear for either left or right, or both of them.

Hope my explanation isn't confusing :)

Sanjeev Veloo
Sanjeev Veloo
1,430 Points

Hi Yulia, How's it going? Thanks for your quick reply. Ah ok... so should we just always clear: both anyway?

Yulia Markina
Yulia Markina
12,616 Points

Hi Sanjeev! In practice I would say yes, I always use clear:both. However, I would just keep in mind that I can also prevent from floating only to the left or to the right.