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

Matthew Clark
Matthew Clark
7,255 Points

Task 1 of 4

I am quite confused on how to do this task. Below is the code I am trying to use.

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

2 Answers

I just pasted your css into the code challenge and it passes.

Maybe try refreshing the page.

While what you wrote will technically work, it can be refactored to be shorter. A hint would be to look at the repeating numbers you have, which are specifying the margin of each side: top, right, bottom, left. You can actually set all of these with just 2 sets of parameters. So it would look something more like this:

    /* Your format */
    nav ul { margin: X X X X; }

    /* Correct (Refactored) Format */
    nav ul { margin: X X; }

Hi Riley,

You might want to update your example to use X and Y. It's impossible to know where the 0 and 10px would go for somebody that didn't already know about this.