23. Pseudo Selectors


I tried everything even body:nth.child(3) or p: nth-child(3) but nothing seems to work.

Can anyone tell me the solution and no i did not use the wrong brackets or forgot one xD

Here is the code:

<!DOCTYPE html>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
	<h3 class="fancy">First Headline</h3>
	<p class="fancy">Paragraph</p>
	<p id="serious">Another Paragraph</p>
	<p>Yet another Paragraph</p>

/*Add your CSS below!*/

.fancy {
#serious {

body: nth-child(4) {

Can anyone please tell me what i did wrong?

Thanks in advance!



Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

With Courtesy to stetim94

or even better use
= https://discuss.codecademy.com/t/how-do-i-format-code-in-my-posts/28351


Thank you for the advice now I know how to post xD


What are you trying to accomplish?


found the solution:
it's not:

body: nth-child(4) {

but it's:

body :nth-child(4) {

put the spacing on the wrong side


Please read

The Browser =load's= this document into Memory
in a pattern that is described as
the Document Object Model
in short the DOM.
( the interpretation of the DOM is Browser & Version specific )

       |                |
     head              body
       |                |
    +--+--+       +---+-+-+---+
    |     |       |   |   |   |
   link  title    h3  p   p   p
                 (1) (2) (3) (4)
                  |   |   |   +- :last-child or :nth-child(4)
                  |   |   +- :nth-child(3)
                  |   +- :nth-child(2)
                  +- :first-child or :nth-child(1)

In the description of your document in DOM-talk...
you will encounter terms like:
parent children sibling descendants ascendants...

The HTML-Element has no parent
is also called document
html-Element is a parent to 2 child-Element's
the 'head'-Element
the 'body'-Element.
head and body are both descendants of html

The 'head'- and 'body'-Element,
both being children to the 'html'-Element
are siblings to each-other.

The 'body'-Element is parent to 4 children
h3 p p and p
These h3 p p p Elements are children of the body-Element
and are descendats of the html-Element and the body-Element
The h3 p p p Elements are sibling's to each other.