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 Debugging HTML and CSS Problems Use Developer Tools

CSS #wrapper background doesn't work when content added to #gallery.

I uploaded my website to kylestem.com but something is not quite right with it.

I am trying to have a red body background and a white wrapper background, but with the gallery content in place, the wrapper background disappears.

Using the developer's tool, I see that it's giving the wrapper 0 height even though that's where the gallery is in my HTML.

Any suggestions?

2 Answers

Hi Kyle, the floated elements are making it collapse to a zero height. Try adding overflow: hidden to the #wrapper div.

#wrapper {
    overflow: hidden;
}

Thank you! Seems to work fine now.