18. Show it if you know it, what's wrong with this code?


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
What is wrong with the code below

<In what way does your code behave incorrectly? Include ALL error messages.>

``` Result facebook Google tweet

stylesheet/css

a :hover {
text-decoration: none;
}
a :first-child {
color: #CDBE70;
}
a :nth-child(3) {
color: #FFC125;
}

<do not remove the three backticks above>

#2

@dasheman,
Try it by closing the a-Tag with </a>
instead of your <a/>


#3

I’ve changed it to as you suggested, thank you.
However I’m now getting this;

Oops, try again. Did you remember to set your first to the color #CDBE70?


#4

Oops, try again. Did you remember to set your first <> to the color #CDBE70?
It wont let me post the letter a in between the <>


#5

@dasheman,
Either use

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

OR

body :first-child {
    color: #CDBE70;
}
body :nth-child(3) {
    color: #FFC125;
}


https://api.jquery.com/first-child-selector/
https://api.jquery.com/nth-child-selector/


#6

That worked, I used the a: which I thought I had. Thanks Leonhard


#7

a:hover {
text-decoration:none;
}

body:first-child {
color: #CDBE70;
}

body:nth-child(3) {
color:#ffc125;
}

I have this and keep getting the same error also.

doesnt instruction 3 specifically say that it’s the first child of the body.

So it wouldnt be
A:first-child {
color: #CDBE70;
}


#8

you can use both a:first-child or body :first-child, notice the space, with the space include, it will select any first child inside the element (in this case body), without the space, it will target any anchor elements (<a></a>) who are first child of any parent