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

Why is the third #gallery showing up in error in CSS

My portfolio is titled, "Gallery" and the HTML has it identified properly. Here's my CSS:

#gallery {margin: 0; padding: 0; list-style: none;}
#gallery li {float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: FFF';} 
#gallery li a p {margin: 0; padding: 5%; font-size: 0.75em; text-align: center}

The Treehouse work space is listing the last row's "#gallery" in red as an error. Thus it won't apply the style listed in the anchor. Why? The styles in the first two rows work and are applied.)

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

So far, all I see that might be considered incorrect is a missing semi-colon after the text-align: center. That should be text-align: center;. If you're still having problems after making that change, we're probably going to need to see a snapshot of your workspace :sparkles:

1 Answer

You are missing a final semi-colon. For this reason, I always separate each command onto a new line to catch errors like this quickly, otherwise it just tells me the whole thing is an error.

#gallery li a p {
    margin: 0; 
    padding: 5%; 
    font-size: 0.75em; 
    text-align: center; //this was the line missing the ;
}