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 trialTre Webb
1,231 Pointsnth-child
When clearing every 4th element, in the video, he uses clear: left. But, clear:both also works, why is left used over both or could you use them both exchangeably.
1 Answer
Steven Parker
231,269 PointsIf you've only used float: left
then there's no difference between clear: left
and clear: both
. Using "both" would only be needed if you had previously used a combination of float: left
and float: right
in the document.
I prefer to use "both" for general purposes unless I specifically want things to wrap around items floated the other way (has never happened yet).