23. pseudo selectors



could anyone check my code?

.fancy {
font-family: cursive;
color: violet;


font-family: Courier;
color: #8C8C8C;

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

Pseudo selectors 23 [Solved] Need space after "body" - descendant selectors vs pseudo selectors

you can't have a space a space between p and :nth-child, without the space it will select the 4th element which is a paragraph of any parent, while with space you select the 4th element nested inside the paragraph


I've already deleted the space, still it doesn't work


your html code is wrong, in exercise21,22 and 23 you have to build the right headings/paragraphs. exercise 21: a h3 heading (close before the paragraph), a paragraph. exercise 22: another paragraph, exercise 23: another paragraph. Only if you have this html code, it will work. Don't add additional headings, it messes up the count.


How about this?





menu list

Pseudo Selectors


you added h1 and h2 headings, never nest paragraph inside heading (your h3 should be closed before you even start any paragraph) and the 3 is missing in the closing tag of the h3 heading

revisit the exercises if needed to get the html structure right


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