In the Pseudo-Class Is There No 2nd Child or 3rd Child? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
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