Nth-child


#1

Oops did you remember to change the third paragraphs colour to #CC0000

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title></title>
	</head>
	<body>
		<div>
			<p>I'm the first child!</p>
			<p>We're not.</p>
			<p>We're not.</p>
			<p>We're not.</p>
			<p>We're not.</p>
			<p>We're not.</p>
			<p>We're not.</p>			
		</div>
	</body>
</html>

/*Add your CSS below!*/
p:first-child {
    font-family: cursive;
}
p:nth-child(2) {
    font-family:Tahoma;
}
p:nth_child(3) {
    color: #CC0000;
}
p:nth_child(4) {
    background-color: #00FF00;
}
p:nth-child(5) {
    font-size: 22px;
}


#2

Compare these:

With these:

Can you spot the major difference? :stuck_out_tongue_winking_eye:


#3

outside of them being different properties and values? I still don't see what I'm doing wrong.


#4

p:nth_child(){

is not the same as

p:nth-child() {

:zipper_mouth: one of the above is not a valid selector


#5

haha wow. how did that happen. thank you :stuck_out_tongue:


#6

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