Select last child element, CSS
ul is a parent tag of li and li is a parent tag of a tag, this code will selects last li tag inside ul tag than the a tag will be select inside li tag.
select last child element
ul li:last-of-type a{color:red;}
in working
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!DOCTYPE html> <html> <head> <style> ul li:last-of-type a{ color : red ;} </style> </head> <body> <ul> <li><a href= "#" > a linke </a></li> <li><a href= "#" > a linke </a></li> <li><a href= "#" > a linke </a></li> <li><a href= "#" > a linke </a></li> <li><a href= "#" > a linke </a></li> <li><a href= "#" > a linke </a></li> </ul> </body> </html> |