First-child & nth-child!


I am doing 18.Show it if you know it exercise & why my code doesn't work by defining a unordered list for links? whats wrong with ul and code?

    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
    <!--Add your HTML below!-->
    <a href="">Learning</a>
    <li><a href="">Movie</a></li>
    <li><a href="">Google</a></li>

but the tester says it's true when my code doesn't work correctly!!!(the color doesn't change as it should)

Lesson 18: Show It If You Know It! Entire CSS Not Working?

what do you use as css selectors? a:first-child and a:nth-child(3)?

because you decided to use a list, the links are both first child of <li></li>, you could use the following css selectors to resolve the issue: li:first-child a and li:nth-child(3) a, this does work because list tag are first and third child of unordered list (<ul></ul>)


I tried it, but it didn't work too!
it just change the circle object before link texts!!


make sense right? link is programmed not to inherit from its parent. that is why, i used li:first-child a, and you used li:first-child. See the difference? i specify link (a) as well, after is specified li:first-child


yeeeees! thnx alot :smile: