17 nth-child


#1

p:first-child{
color:red;
font-family:cursive;
}
p:second-child {
font-family:Tahoma;
}
p:third-child{
color:#CC0000;
}
p:fourth-child{
background-color:#00FF00;
}
P:fifth-child{
font-size:22px;
}
Can somebody help me please,it replies;Oops, try again. Did you remember to make the second paragraph's font-family Tahoma?


#2

Your first Pargraph is fine but the others are the problem.

You can actually select any child of an element after the first child with the pseudo-class selector nth-child; you just add the child's number in parentheses after the pseudo-class selector. For example,

p:nth-child(2) {
    color: red;
}

So you Code should look like:

p:first-child{
color:red;
font-family:cursive;
}
p:nth-child(2) {
font-family:Tahoma;
}
p:nth-child(3){
color:#CC0000;
}

and so on..


#3

tnc,it actually works.


#4

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