Need help with CSS Selectors


I am having trouble changing the colors of three links while using
a:first-child {
color: #CDBE70;

a:nth-child(3) {
color: #FFC125;

The links are all turning the same color from the first-child code.
Here are the links I am using.
<p><a href="">Pandora</a></p>
<p><a href=""> Codecademy</a></p>
<p><a href=""> Amazon</a></p>

18 Show it if you know it! CSS Selectors is what I am on atm.


the exercise sort of assumes you nest the links directly inside body, this would give different colors.

When you use paragraphs, all links are first child of paragraph. But wait, paragraph are first, second and third child of body, so we could use the paragraphs for the count:


and then select the link element inside the paragraph:

p:first-child a
p:nth-child(3) a

however, this code will not pass the exercise.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.