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

Question on CSS padding for four values.

Dear All,

I am stuck on a question and can't see where I am going wrong, the question is this:

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.

So I put this:

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

It doesn't like it for some reason, I have tried variations but cannot get where I am going wrong.

8 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points

Try

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

While your answer is technically correct, and would work in the wild, the quiz is looking for a very specific format. It wants the padding set with the two-value shorthand.

Something like padding: top-bottom left-right;

You just gotta fill in the values.

Ok thanks for coming back to me so quickly, if I understand you correctly I need to try padding: 15px 10px;

I have tried that also and it doesn't work it just says the top padding for nav links should be 15px

Weird. Can you post the link to the quiz?

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points

Is it possible it's asking for 4 declarations?

padding-bottom: 15px;
padding-top: 15px;
padding-left: 10px; 
padding-right;: 10px; 

that was another thing I tried and it gives the same error.

woohoooo thats the fella so I was missing the a part out wasn't I ???

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,254 Points

Yup and I should have spotted it earlier. It was looking for a set of links inside a nav element. :)

thanks very much for your help guys really appreciate it.