23. Pseudo Selectors


#1

I get this error message, and do not understand what I am doing wrong. I have reset the zoom several times...

"Oops, try again. Did you give your third paragraph a font-size of 26px? It looks like it's currently undefined."

.fancy { 
    font-family: cursive;
    color: violet;
}
#serious {
    font-family: Courier;
    color: #8C8C8C;
}
p:nth-child(4) {
    font-size: 26px;
}

#2

You need to select the 4th item in the body..


#3

I tried that too, but could not get it to work..
Do you mean:
body:nth-child(4) {
font-size: 26px;
}


#4

Yes but you need to leave a space like this:

body :nth-child(4){

#5

I did this but get the same error message..

body :nth-child(4){
font-size: 26px;
}


#6

Okay leave it like that(your last post)

Show me your HTML maybe an error there


#7

Here is my HTML:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<h3 class="fancy">
		    <p class="fancy">BLAA</p>
		    <p id="serious">ASJ</p>
		    <p>haa</p>
		</h3>
	</body>
</html>

#8

I understood it... My h3 closing was not the right place


#9

You have your paragraph tags inside your h3 you shouldn't do that.. Close your h3 tag on the same line as you opened it


#10

Yeah sorry I was typing didn't see your post that you figured it out :slight_smile:


#11

why is p:nth-child(4) not valid? nth-child counts all elements, and if the 4th element is a paragraph, apply the styling, which is valid if the h3 is closed before the paragraphs.