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

Code Challenge says I am incorrect.

the code challenge question is:

Select the links inside the nav element and set their font weight to 800. Then, set padding on the top and bottom to 15 pixels. Set the padding on the left and right to 10 pixels.

and I entered the following code:

nav li { font-weight: 800; display: inline-block; padding: 15px 10px; }

and it says that I am wrong and that the top padding should be 15px.

here is the link:

https://teamtreehouse.com/library/create-a-horizontal-list-of-links

5 Answers

Sorry Ziv. I thought it was the first part that you were having trouble with. Here's the whole bit:

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

nav li {
  display: inline-block;
  font-weight: 800;
}

nav a {
  padding-top: 15px;
  padding-bottom: 15px;
  padding-left: 10px;
  padding-right: 10px;
}

You were trying to change the padding for the list items, when they wanted it changed for the links.

Thanks,

James Corum

I was getting mixed up with the nav li and nav a.

Several issues. When I went to the challenge, it says "Select the unordered list nested inside the nav element. Remove the margins on the top and bottom. Set the margins on the left and right to 10px."

You are selecting the list items li, not the unordered list ul, and you are not changing the margins. Try this:

nav ul { 
  margin: 0 10px 0 10px;
}

That bit was fine, its the padding for the nav links which had to be changed to 15px top and bottom and 10 px left and right (padding: 15px 10px; and even tried padding: 15px 10px 15px 10px;). but it says that the top padding should be 15px?

You are only defining padding for 2 parameters. It looks like you need 4. Something like this with the numbers changed. p { padding: 50px 30px 50px 80px; }

I already tried that before and it still says the top padding for nav links should be 15px

i have the same problem :/

i finally solve it :D the answer is :

nav ul{ margin: 0px 10px 0px 10px; padding: 0;

}

nav li { display: inline-block; }

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