HTML CSS examples for CSS Selector:first-child
Select the first child element of every <ul> element
<!DOCTYPE html> <html> <head> <style> ul > :first-child { background:red; } </style><!-- ww w . j ava 2 s .c om--> </head> <body> <ul> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> <ul> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> </body> </html>