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 trialLili Köves
3,471 PointsPadding not showing, what might be the problem?
When setting the padding for the paragraph in the gallery it does not show. Not when I set it to 5%, not at 30% or 50%. I checked the code again and again, but I do not find the cause.
gallery {
margin: 0;
padding: 0;
list-style: none;
}
gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
gallery li a p {
margin: 0%;
padding 5%;
font-size: 0.75em;
color: #bdc3c7;
}
3 Answers
Max Dubinin
12,807 PointsIf I'm not mistaken when you're using css selectors, this statement "gallery li a p" tries to apply the styling to a paragraph inside of an anchor, that is inside of a list item, inside your gallery...
Max Dubinin
12,807 PointsDid you put a dot before your gallery class?
.gallery li a p {}
I also noticed that you forgot a colon between the "padding" and the value
padding: 5%;
Lili Köves
3,471 PointsThank you I'll check it right now.
Lili Köves
3,471 PointsIt worked, of course! Thank you!
Max Dubinin
12,807 Pointsyou're welcome!
Lili Köves
3,471 PointsLili Köves
3,471 PointsYes, inside an unordered list there are list elements, inside them anchors, and inside them an image and a paragraph each.