Did you give your third paragraph a font-size of 26px?


#1

I keep getting this error message. Can someone please help?
Oops, try again. Did you give your third paragraph a font-size of 26px? It looks like it's currently 16px.

This is my css.
/*Add your CSS below!*/
.fancy {
font-family:cursive;
color:violet;
}

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

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


Lesson 23 Pseudo selectors
#2

The first thing I would do here is remove body from the selector. It is implied. The simple selector will do the same job. Next I would be suspicious of white space that is not engrained in my mind as common syntax.

:nth-child(4)

This will select all elements that are the fourth child of their parent element.

Now if we have mixed element nodes as siblings and nodes are being dynamically added to the 'family' tree, new sibling nodes, that is, and we know that they will never prepend their earlier siblings, we can zero in on a node type.

p:nth-child(4)

will select every paragraph that is the fourth child of its parent node.

Likewise we can zero in on the nth element of type,

p:nth-of-type(3)

#3

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