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

Lili Köves
Lili Köves
3,471 Points

Padding 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
Max Dubinin
12,807 Points

If 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...

Lili Köves
Lili Köves
3,471 Points

Yes, inside an unordered list there are list elements, inside them anchors, and inside them an image and a paragraph each.

Max Dubinin
Max Dubinin
12,807 Points

Did 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
Lili Köves
3,471 Points

Thank you I'll check it right now.

Lili Köves
Lili Köves
3,471 Points

It worked, of course! Thank you!