23.Pseudo Selectors Help


#1

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

My Code 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">Hello</h1>
		<p class="fancy"> this is a useless post :/ </p>
		<p id="serious"> Hey </p>
		</h3>
		<P> Again I am bored </p>
	</body>
</html>

CSS:

/*Add your CSS below!*/

.fancy {
    font-family:Cursive;
    color:violet;
}

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

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

Any help appreciated :smiley:


#2

you need a space between body and :nth-child(4) to select the 4th element inside body. If you do this without space, it will check if the 4th element is a body (it is not, it is a paragraph)

This only works if your html code is correct, below are instructions on how to make it visible

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:

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

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

```
<p>visible</p>
```

the backtick is located above the tab key on your keyboard


#3

Updated the thread hopefully be able to fix it.


#4

Did you fix the space between body and :nth-child(4)?

anyway, you should never nest paragraphs in heading (and vice versa).

This closing heading closing tag:

<p id="serious"> Hey </p>
</h3> <- this one

should be where you currently have a h1 closing tag (remove the h1 closing tag which doesn't match your h3 opening tag). Then you should be good


#5

What do you mean I don't have a closing /h1 tag I have a closing /h3 tag because I had a opening h3 tag not a h1, Also I did put a space after body. I also changed my paragraphs so there not nested anymore. Also I am curious why is it bad to nest them?


#6

I see what's wrong now, my bad haha

EDIT: Issue Fixed, Thanks alot @stetim94


#7

Paragraphs tags are designed to hold inline elements, not other block elements (headings)

Sounds like you fixed it, you understand everything? I do not get notified of edits, just so you know


#8

Yeah I fixed everything and yeah I get it now, it was a stupid mistake.Thanks again