In the Pseudo-Class Is There No 2nd Child or 3rd Child? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In the Pseudo-Class Is There No 2nd Child or 3rd Child?

Im curious. #parent p:last-child { color: green; text-decoration: underline; } does second child come in?

20th Aug 2017, 7:51 AM
Rex John
Rex John - avatar
1 Answer
0
You can use nth-child. Counting the position starts at 0. This should do the trick for the second: p:nth-child(1)
20th Aug 2017, 8:46 AM
James
James - avatar