18. show it if you know it! help adding unordered lists?


#1

i completed this section as instructed successfully but wanted to know if i had put the three links i created in to an unordered list then how would i write my css selectors: first-child and nth-child()? currently they all show as color:#cdbe70 instead of 3 different link colors? i have tried unsuccessfully using:

li a:first-child{
color:#cdbe70;
}

any ideas would be gratefully received! Below are my html and css.



#2

we are going outside teh scope of this exercise.

all your links (<a></a>) are first children of its parent (<li></li>), so a:nth-child(3) will have little effect. However, the list itself are first, second and third child of its parent unoredered list:

<ul>
  <li></li><!-- first child -->
  <li></li><!-- second child -->
  <li></li><!-- third child -->
</ul>

so we can use that:

li:first-child {}
li:nth-child(3) {}

however, links will not inherit from it's parent, but we can just specify we want the link inside the first and third list:

li:first-child a {}
li:nth-child(3) a {}

does that make sense? (again, this is outside the exercise, this code will not pass)


#3

thank you so much 'stetim94' i understand it and i am grateful for the help! It does not pass but i had already completed the exercise provided and it was just for my own benefit. it does help me understand how to use the first-child nth-child() within lists which is great. thanks.


#4

Why did you think i said we where going outside the scope of the exercise? The exercise doesn't take in account if you where to use list or paragraphs. Good you understand, glad i could be of help


#6

oh never mind I see the problem.