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 How to Make a Website Adding Pages to a Website Add and Style Icons

Cosmin Iuga
Cosmin Iuga
2,352 Points

I'm stuck completing this exercise

Can someone help me find the issue here?

Thanks

css/main.css
a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

#logo {
  text-align: center;
  margin: 0;
}

h1, h2 {
  color: #fff;
}

nav a {
  color: #fff;
}

nav a:hover {
  color: #32673f;
}

h1 {
  font-family: Changa One, sans-serif;
  font-size: 1.75em;
  font-weight: normal;
}

img {
  max-width: 100%;
}

#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
}

#gallery li {
  float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
  color: #bdc3c7;
}

nav ul {
  list-style: none;
  margin: 0 10px;
  padding: 0;
}

nav li {
  display: inline-block;
}

nav a {
  font-weight: 800;
  padding: 15px 10px;
}

.profile-photo {
  display: block;
  margin: 0 auto 30px;
      max-width: 150px;
  border-radius: 100%;
}

.contact-info {
     min-height: 20px;
     background-repeat: no-repeat;
     list-style: none;
     margin: 0;
     padding: 0;
     font-size: 0.9em;
}

.contact-info li a {
  display:block;
}

16 Answers

Cosmin Iuga
Cosmin Iuga
2,352 Points

Yay... It worked... looking at what was the difference...

Looks like it's asking for it on the anchor elements, have you tried:

.contact-info {
     list-style: none;
     margin: 0;
     padding: 0;
     font-size: 0.9em;
}

.contact-info li a {
display: block;
min-height: 20px;
background-repeat: no-repeat;
}

.contact-info li a { display:block; margin: 0 0 10px 0; }

This doesn't work...

.contact-info li a {
display: block;
min-height: 20px;
background-repeat: no-repeat;
background-size: 20px 20px;
padding: 0 0 0 30px;
}
Cosmin Iuga
Cosmin Iuga
2,352 Points

Hi Mike,

It worked. now I'm stuck on:

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.

Cosmin Iuga
Cosmin Iuga
2,352 Points

Thank you Mike.

So here's what I have and it fails:

.contact-info { list-style: none; margin: 0; padding: 0; background: 20px; font-size: 0.9em; }

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

background-size: 20px 20px;
Cosmin Iuga
Cosmin Iuga
2,352 Points

So it was 0 0 0 30px because we we're looking for the left one. Correct?

Right, in order it is top, right, bottom, left, so 0 0 0 30px is 0 top, 0 right, 0 bottom, and 30px left.

Cosmin Iuga
Cosmin Iuga
2,352 Points

that's awesome. thank you.

BTW... it's still not working :(

Cosmin Iuga
Cosmin Iuga
2,352 Points

So this is what it's asking me:

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.

Then this is the error that I get:

Bummer! Did you set the background size for contact-info links to 20px?

Hmm, I haven't done this particular challenge, but perhaps you could try:

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

Looks like it wanted you to use

.contact-info a

instead of

.contact-info li a
Cosmin Iuga
Cosmin Iuga
2,352 Points

yes... that it looks like... Just noticed that...

Next one is:

With the anchor elements inside the contact-info list still selected, set the bottom margin to 10 pixels. Set all other margins to 0.

Same as padding, think top right bottom left:

margin: 0 0 10px 0;
Cosmin Iuga
Cosmin Iuga
2,352 Points

yes... did that one by my self...

Thank you much...

.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; }

This finally worked.

Best answer should be selected in this thread so that others facing this challenge know there is an answer within.

Cosmin Iuga
Cosmin Iuga
2,352 Points

Here's what it's asking for:

With the anchor elements inside the contact-info list still selected, set a minimum height of 20 pixels. Then add a declaration that will prevent the background from repeating.