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 trialSanjeev Veloo
1,430 Pointsclear: 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
12,616 PointsHi 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
1,430 PointsHi Yulia, How's it going? Thanks for your quick reply. Ah ok... so should we just always clear: both anyway?
Yulia Markina
12,616 PointsHi 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.