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 Portfolio

# gallery and # gallery li

Why couldn't the contents of '#gallery li' be written in '# gallery'? Also, how do we ensure that the footer stays at the bottom of the page and is not included in the 2nd column?

2 Answers

Tod McChesney
Tod McChesney
19,028 Points

Because the css declarations in the selector "#gallery li" are targeting just the list items that are child elements of the parent ul that has been given the id "gallery". You want to style just those list items not the entire ul parent container.

The footer is moving up into the second column because the images above it are floated. In order to fix this you will need to clear the float in the footer by adding the "clear: both;" declaration to your footer element selector. This will tell the browser to clear the float property which will put the footer on a line by itself.

Of course. Thanks so much!

thanks! but my images' and their backgrounds are not together. the background is wider than the image