HTML CSS examples for CSS Selector:element parent child
Css selector : parent and child element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> li:first-child {<!-- w w w . jav a2 s . c om--> color:Chartreuse; } li:last-child { color:yellow; } </style> </head> <body> <ul id="parent"> <li>Lorem ipsum dol</li> <li>Lorem ipsum dolo</li> <li>Lorem ipsum dol</li> </ul> </body> </html>