Pseudo selectors


#1


So for this exercise I have to make the 4th child 26px. Which is what I think my code is doing below. Problem is when I run it nothing changes in the display. But when i change the nth-child to (3) instead of (4) It works. I get an error message both times. Please help.


<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
	
		<h3 class="fancy">Pizza<h3>
		
		<p class="fancy">I love Pizza</p>
		
		<p id="serious">And Ice cream</p>
		
		<p>Please Work</p>
		
	</body>
</html>

CSS:

.fancy{
    font-family: cursive;
    color: violet;
}

#serious{
    font-family: Courier;
    color: #8C8C8C;
}

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


#2

because you need to use nth-child(4), the problem is your h3 closing tag is missing the forward slash, messing up the count


#3

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