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 Styling Web Pages and Navigation Create a Horizontal List of Links

Nico Mizono
Nico Mizono
1,300 Points

Code does not let me pass for challenge 4 of 4

Is there a bug with this code challenge?

It tells me to set the padding on top/bottom to 15 px and left/right to 10px, which is what I did:

nav li{

padding: 15px 10px;

}

But it does not let me pass.

Please help.

6 Answers

Thiago van Dieten
Thiago van Dieten
16,639 Points

Hello!

Let me quote the question for you on 4/4: " 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."

Instead of selecting the links inside the nav element, you are currently selecting the list items inside the nav!

I hope this helped you answer the question. :)

It's nav a { padding:15px 10px 15px 10px; font-weight: 800; } They want you to select the links, not the list.

Nico Mizono
Nico Mizono
1,300 Points

Yep sorry. I didn't use a comma after "li" to select the links. CSS should look like:

nav li, a { padding: 15px 10px:

}

Thanks!

Emma Willmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emma Willmann
Treehouse Project Reviewer

Are you also changing the font weight? I just tried it out and I was able to pass. "nav a" is already out there as a selector changing the color to #fff, I just added the font-weight and padding properties. I also tried it a second time, and I was able to do it with the selector "nav li a" (no comma). Also, make sure to use a semi-colon after your property and value, not a colon. Hope that helps.

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

or

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

James Ingmire
James Ingmire
11,901 Points

You didn't put a full stop or a hash tag before the nav.

James Ingmire
James Ingmire
11,901 Points

If its a 'class' then use a full stop before the nav or if it's an 'id' then use a hash tag # before the word nav. Hope this works, certainly wont be treeehouse developers, i used to wish it was tho when I was stuck lol.