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 trialSunny Bradford
431 PointsWhy 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.)
1 Answer
Philip Gales
15,193 PointsYou 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 ;
}
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherSo far, all I see that might be considered incorrect is a missing semi-colon after the
text-align: center
. That should betext-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