Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.