This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS Selectors Forum

View Course

319 points
522b75b4abf8219ae3002fbe_436630563
Submitted by
Max Giliberti
about 3 years ago

Last step of the CSS selectors. Pseudo selectors nth-child

Hello. im stuck at the last step of CSS selectors. i did pass the nth-child at the step 4.4 but now, its not working at 5.5. Here is my HTML code:

my html:

<html>
<head>
    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
    <title>Result</title>
</head>
<body>
<h3>
<p class="fancy">nota1</p>
<p class="fancy">nota2</p>
<p class="fancy">nota3</p>
<p>nota1</p>
<p>nota2</p>
<p>nota3</p>
</h3>
<p id="serious"> nota de id</p>
</body></html>

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

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

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

Instructions says:
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!

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

Anyone tell me what im missing here ? i tryed a lot of combinations. i tryed with and without space between body and :
i tryed p as a selector but didin't work too. By the way Here is the Hint: That means you'll need to use nth-child(4) to select your paragraph on the CSS tab.

If you're getting strange numbers for your font-size, type Ctrl-0 or Cmd-0 to reset your zoom!

Make sure to leave a space between body :nth-child. If you don't have a space it means "find the body tag that is an nth-child". If you have a space it means "find the nth-child of the body tag".

I almot copy paste it but still not working. Any advise ?


0 votes

permalink

You need to make each h3 and p its own line, don't nest anything.

299 points
93bcdcce1094b5491ac76c1518771051?s=140&d=retro
Submitted by
Cody West
about 3 years ago


0 votes

permalink

For some reason it looks for a space between body and :nth-child.

150 points
8b748647b7b6a873020f552e4c55c0ce?s=140&d=retro
Submitted by
mcreisinger
over 2 years ago