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

HTML How to Make a Website Styling Web Pages and Navigation Style the Image Captions

Michal Dunski
PLUS
Michal Dunski
Courses Plus Student 3,136 Points

Why is the footer floating like one of the images despite not being a part of the <ul id="gallery>?

I can't get it, why is it behaving like that even though the float setting are not assigned to that element?

Simon Duchaine
Simon Duchaine
14,441 Points

Can you paste your code?

2 Answers

Julian Aramburu
Julian Aramburu
11,368 Points

When you float an element it doesn't follow the flow of the page...so if you float an element and it has another element underneath the last one will get over that element until you float it too or add clear: left/right/both to it.

Julian Aramburu
Julian Aramburu
11,368 Points

Hi Michal! Maybe you need to clear your footer element? Otherwise paste your code in here so we can help you out!

Michal Dunski
Michal Dunski
Courses Plus Student 3,136 Points

Yes, of course. It's more of an theoretical question actually, why does this setting affect the element that shouldn't be affected as it's set to #gallery, which doesn't contain a footer? I'm just asking, because it seems illogical to me.