Pseudo Selector


#1

link https://www.codecademy.com/en/courses/web-beginner-en-WF0CF/4/5?curriculum_id=50579fb998b470000202dc8b#

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

Existing HTML code


Existing HTML
<title>Result</title>
	</head>
	<body>
		<!--Add your HTML below!-->
		<h3 class="fancy">
		   <p class="fancy"> Hello </p>
		   <p id="serious"> Hello </p>
		 </h3>  
		
		
	</body>
</html>

Existing CSS

/*Add your CSS below!*/
.fancy{
      font-family:cursive;
      color:violet;
}
#serious{
     font-family:Courier;
     color:#8C8C8C;
}


The exercises asks us to do the following

Add a third paragraph to the HTML document. On the CSS tab, use nth-child to give it a font size of 26px. Remember: your paragraph is the third paragraph, but the fourth CHILD of body. The h3 counts as the first child!

Here is my solution

HTML

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<!--Add your HTML below!-->
		<h3 class="fancy">
		   <p class="fancy"> Hello </p>
		   <p id="serious"> Hello </p>
		 </h3>  
		 <p> Hello </p>
		
		
	</body>
</html>


Updated CSS

/*Add your CSS below!*/
.fancy{
      font-family:cursive;
      color:violet;
}
#serious{
     font-family:Courier;
     color:#8C8C8C;
}

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


So I added 

HTML

<p> Hello </p>


CSS 
body :nth-child(4){
    font-size: 22px;


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


#2

paragraphs are not designed to be nesting inside headings, all paragraphs should be after the heading:

<h3>heading</h3>
<p>first paragraph</p>
<!-- remaining 2 paragraphs -->

#3

adjusted my code

<h3 class="fancy"> Hello </h3>
	   <p class="fancy"> Hello </p>
	   <p id="serious"> Hello </p>
	   <p> Hello </p>

but its still giving the same error, but thanks for that input, very helpful for me , I appreciate it


#4

if you change the font-size to 22px instead of the required 26px, you indeed get an error. I thought that would be a bit obvious?


#5

Ah got it thank you !


#6