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 trialCaroline Guzman
433 PointsWondering about floating footer
Nick says that when the footer ends up floating with the gallery it is acting the way it has been told to. He tells us we can fix it by adding 'clear: both;', however, I want to know what it is about the footer style code that tells it to float with the gallery if in actuality there is no 'float' code in the footer element. This is a snapshot of my css without fixing the footer. https://w.trhou.se/zgyxlvb5dv
1 Answer
Erik Nuber
20,629 PointsIt isn't that the footer is floating, it is that the items above it are set to float.
When something gets "floated" it is taken out of the normal layout and the item loses its height so things that around it behave in such a way to run around that item.
When you clear the float, it just tells the specific item, in this case the footer to respect the height of the floated items so it pushes it back down to where it belongs
Here is an excellent description about floats and clears that should help you understand better.
Caroline Guzman
433 PointsCaroline Guzman
433 PointsMakes so much sense. Thank you!