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

CSS

Adding Pages to a Website: Add Style Icons Challenge Question

Here is the questions for task 4 of 5: With the anchor elements inside the contact-info list still selected, set the background size to 20 pixels square. Then set the left padding to 30 pixels, with all other padding at 0.

And here is my code:

.contact-info a { display: block; min-height: 20px; background: no-repeat; background-size: 20px; padding: 0 0 0 30px; }

Everything looks good, but it won't let me pass the challenge. Please let me know if you see anything wrong. Thanks.

3 Answers

Hi Sean! I'll be happy to help you out. You almost had the right answer but you're missing one small thing. The extra 20px to make it a square. I think you have to specify two values when you're setting it to a specific pixel size. Also I think you may be having an issue with how you declare the background repeat property as well. Try the following:

.contact-info a {
  display: block;
  min-height: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding: 0 0 0 30px;
}

Hi Sean,

It's saying "20px square" so you have to specify both the width and the height to be 20px.

background-size: 20px 20px;

Thanks guys. I figured it out, said Doh! out load and then immediately saw your responses. Thanks again.