Psuedo selectors


I've tried every type of scenario:

<!DOCTYPE html>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<!--Add your HTML below!-->
		<h3 class="fancy">i am a header</h3>
    <p class="fancy">First paragraph. </p>
    <p id="serious">Second paragraph.</p>
    <p>Third paragraph.</p>

/*Add your CSS below!*/
#serious {
    font-family: Courier; color:#8C8C8C
.fancy {
    font-family:cursive; color:violet
body: nth-child(4) {


I can't see your HTML
How to insert code into a post


when selecting the 4th child in body, make sure you get the spacing in body :nth-child(4) right, it isn't in your case.

@zainabrawat, i thought cursive was a font-family which started with a lowercase c? Too lazy too check :stuck_out_tongue:


@stetim94 I had my doubts about it being uppercase or lowercase, I suggested it to another learner and it worked thus I mentioned it..


I'm having the very same problem. I'm doing everything right. It's telling me I haven't set my font-size to 26px.
My coding is like so - body :nth-child(4) { font-size:26px }
I've tried all the opening and closing spaces - still won't go through.


Can i see your full html and css code? This only works if this the rest of the code is also correct


Hi Stetim,
Here is the coding.

<!DOCTYPE html>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<h3 class="fancy">This Okay?<h3>
		   <p class="fancy">This is a paragraph</p>
		   <p id="serious">This is another paragraph</p>
		   <p>This is a third paragraph</p>

Sorry - I'll cut and paste the CSS now.


your h3 closing tag is missing a slash, which screws up the count of nth-child

for next time, use one of the two following options to make your code/indent is visible:

select your code and press ctrl + shift + c (or cmd + shift + c if you use a mac)

if this instructions are unclear, you can also insert 3 backticks before and after your code, like so:


the backtick is located above the tab key on your keyboard


Hurrah!! You're a total star stetim94!
That's done the trick. Well spotted. Thanks!!


hello, everyone, for the nth-child selector, why do we have to put space between body and :nth-child?
for the p:nth-child(n), we are not asked to do so??

thank you


to select the 4th element inside body.

this will select the 4th element (if it is a paragraph) of any parent