Nth-class selector problem

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I was playing around with the nth-class selector and noticed that it was also styling the p that is outside the div and isn’t the 3rd child.
I would understand if the 3rd p of the body ended up green, but why is the p right after the div green?

note: I know I could use div p:nth-child(3) to be specific.

``` p:nth-child(3) { color:green; }

Not green.

Not green.

This is green.

Why is this green?

Not green

Shouldn't this be green?

<do not remove the three backticks above>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.