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

Add and Style Icons. Need help 4/5

I'm currently on task 4/5, The question is "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." so from the step before I have stayed within the same element and I put everything it said and it keeps saying "Did you set the background size for contact-info links to 20px?"

This is my code so far...

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

I think you're currently only setting the vertical portion of the background size. You should also set the horizontal. so to make it a 20px square the size is 20px by 20px

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

2 Answers

Hi Elijah,

Your'e close.

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

Jeff

Thanks, I thought because it was the same it would automatically adjust both to 20px.

That's what I would have thought, too... Maybe something is wrong with the test.

Benjamin Dalton
Benjamin Dalton
10,725 Points

"The background-image contains its WIDTH and HEIGHT" (Emphasis added) http://www.w3schools.com/cssref/css3_pr_background-size.asp

so the first 20px is the Width while the 2nd 20px is for the Height.