Getting error for nth child task


#1

What i'm trying to accomplish:

HTML:

<body>
        <h3 class="fancy">Head3<h3>
        <p class="fancy">paragraph</p>
        <p id="serious">para2</p>
        <p>Brianna</p>
	</body>

CSS:

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

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

Why am I getting this error message, is there something wrong with my code?
Thanks for the help in advance :smile:


#2

Hey @brianna_vaykeas_com! Its the pargraph your suppose to set it. So codecademy dosent know what to set to 26px.

So instead of this(whitch is not defined ) :

Do this:

body  p:nth-child(4) {

#3

Thanks @amanuel2 - this causes the desired effect to the 3rd paragraph, but i'm still getting the error message that will not let me save and move on. I suspect this may be a bug... :frowning:


#4

screen shot your window. Will you?


#5


#6

Oh Sorry! I forgot put it as the fourth element not the third since its one more. This will surely solve your problem


#7

unfortunately, everything i have tried is resulting in the same . My code clearly works because the font size is indeed increasing on the preview page, not sure why i can't save and submit code


#8

Type in 4 and take a screen shot.(sorry im making you take a lot of screenshots). But i need a Mod to look at this so they can fix it or identify your problems

Mod Calling(not to you): @albionsrefuge @mtf @zystvan @jacobsandersen @leonhard_wettengmx_n


#9

No problem, I appreciate your help!


#10

Try body:nth-child(4). From the instructions, that seems to be what the grader is hinting at.

This is because p has no children. p itself is a child, but it is not a parent of anything but the text.


#11

same result:


#12

Ok, my bad.

Try this:
p:nth-child(3) { font-size: 26px; } (spacing as necessary)

but ALSO, go to your browser's zoom settings to make sure they aren't zoomed in. To quickly see if you're zoomed it, press the key combination ctrl+0 to reset to 100%. An incorrect zoom can cause a grading glitch.


#13

confirmed my browser is set to 100%

still unable to save


#14

That h3 element needs a / in its closing tag.


#15

@albionsrefuge That fixed it!
Thank you!!!


#16

2 posts were split to a new topic: I have a problem with the nth term