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 trialChris Boehme
480 PointsI can't get past this challenge with top padding
It keeps telling me to add 15 pixels of top padding on the top and bottom of the navigation links. I've done the following code:
nav li { padding-top: 15px 0 15px 0; }
I can't figure out why it isn't working
Chris Boehme
480 PointsI figured out my issue ~ I didn't need to worry with padding-top and it should have been "nav a" as the selector:
nav a { font-weight: 800; padding: 15px 10px 15px 10px; }
Sorry for the bother
5 Answers
Sreng Hong
15,083 PointsHi Chris. The challenge is asked to select the link inside the navigation, but you select the list inside the navigation. So it should be like this:
nav a {
}
Sreng Hong
15,083 PointsAlso, you use a wrong property. It should be only padding
.
tuukka uosukainen
22,107 Pointsyou have used padding-top. Change it to just padding.
like this:
nav li {padding: 15px 0;}
Hope this helps!
Steven Byington
13,584 Pointssince you are adding to the top and bottom you only need one number. You also said padding-top, and then declared padding for all for sides. It should look something like this.
nav li { padding: 15px 0; }
tuukka uosukainen
22,107 PointsOh, thanks for correction Sreng!
I’m sorry for giving bad advice :(
Sreng Hong
15,083 PointsIt's okay man.
Chris Boehme
480 PointsThese are the directions: "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."
I thought the correct code would be:
nav li { font-weight: 800; padding-top: 15px; padding: 0 10px; }
Is this not correct ?
Steven Byington
13,584 PointsThe links inside the nav element would be
nav a {}
the padding for top and bottom is the same, so you can just use one number to represent both. Your code should look like this.
nav a {
font-weight: 800;
padding: 15px 10px;
}
Chris Boehme
480 PointsChris Boehme
480 PointsThese are the directions: "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."
I thought the correct code would be:
nav li { font-weight: 800; padding-top: 15px; padding: 0 10px; }
Is this not correct ?