Home / CSS / Select the last items with nth-child in CSS

Select the last items with nth-child in CSS

li:nth-last-child(-n+2) {color:red;}

Hits: 4

Leave a Reply