Pseudo selectors 23


Could you check my code please? I must be doing something wrong...

<!DOCTYPE html>

	<h3 class="fancy">This is a h3 header</h3>
	 <p class="fancy">This is a paragraph</p>
	 <p id="serious">This is a serious paragraph</p>
	 <p>This is a 4th child aparently.</p>



.fancy {


serious {



body: nth-child(4) {

I can't get the text size to change for the nth-child(4)


There are two ways you can use nth-child(4) in this case:

body :nth-child(4)

(note where i put the spaces around the colon), when use you use body :nth-child(4) you select the 4th element inside body, when using p:nth-child(4) you select a paragraph which is 4th child of a element.


Ah yeah I see, So why was body: nth-child(4) not working?


Because whoever build the nth-child, decide that body :nth-child and p:nth-child are the syntax, and not a combination of those. body: nth-child simple is invalid syntax


Aaaaah, I didn't see the space was after body, thanks :smile:


I mention it in my original answer:

That you have to look closely where the spaces are.


I'm having the same problem, but I did put the space between the "body" and the ":nth-child(4)" and I'm still getting the error message.


I cut/pasted from the code provided here. It was rejected.

Out of curiousity, I tried changing things other than the font size. NOTHING (tried changing font. color, etc, using the right syntax. Also giving "body" an id, and using that as the CSS identifier. Nada.


I explained in the topic you created that you h3 closing tag is missing a slash. Plus, you said there that you resolved the issue, please let us know in this post your resolved as well, so we know we don't have to look into it anymoer


Im also stuck here. Everything has been done in accordance to the instructions.

The code:

	<!--Add your HTML below!-->
	<h3 class=fancy>Jaman</h3>
	<p class=fancy>Kan inte</p>
	<p id="serious">Skojar enteeee</p>
	<p>Dödsallvar bror</p>

}/*Add your CSS below!*/



body: nth-chil(4){


I would like to quote my earlier answer.

now take a close look at your nth-child, and the specifically the spacing around the colon.It is a bit frustrating if you have to repeat yourself


I'm also having problems with this lesson, after reading your solutions i don't resolve my problem.

Graphic Monarchy

Donec ullamcorper nulla non metus auctor fringilla. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Sed posuere consectetur est at lobortis. Maecenas faucibus mollis interdum. Aenean lacinia bibendum nulla sed consectetur.

Etiam porta sem malesuada magna mollis euismod. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Curabitur blandit tempus porttitor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Nullam id dolor id nibh ultricies vehicula ut id elit.

Cras mattis consectetur purus sit amet fermentum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum id ligula porta felis euismod semper. Donec sed odio dui. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

/*Add your CSS below!*/
font-family: cursive;
color: violet;



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


Can i see your html code? if you edit/update your question, leave a reply so i get a notification. Your html code is not visible, take the following steps to make your code visible:

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


no, you should just insert the back-ticks before and after your code. <p>visible</p> was just some example code

indent preformatted text by 4 spaces<img src="//" width="555" height="500"> sorry i didn't understand


try the following: select the code (using your mouse) and press ctrl + k (or cmd + k if you have a mac computer)


and then? what do i need to do?


that is it, you copy your code to the forum, select the code and press ctrl + k. Then your code is visible.

indent preformatted text by 4 spaces


damn what a hussel to fix this, don't understand what i do wrong.