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

help

Create a child selector that targets li elements that are direct children of .main-nav. Set the display to inline-block and the left margin to 20px.

8 Answers

Use the ">" character to target direct descendants.

.main-nav > li {
 display: inline-block;
 margin-left: 20px;
}

it said Make sure you're targeting img elements in your selector.

this one works for me yu can try it .main-nav > li { display: inline-block; margin-left: 20px; }

Thanks!!

If main-nav is a ordered or unordered list then you don't need the ">" character to target direct descendants.

.main-nav li { display: inline-block; margin-left: 20px; }

its not letting me pass on to the next step

There is probably some kind of content I don't know about from the video before the quiz. Send me a link and I will figure it out for you

You can try this one, hope it works .main-nav > li { display: inline-block; margin-left: 20px; }

Ian Z
Ian Z
14,584 Points

wow none of these work

/* Complete the challenge by writing CSS below */ .main-nav >li{ display: inline-block; margin-left: 20px; }

thanx i mannaged to pass that.