HTML CSS examples for CSS Selector:element parent child
Select first child of class in different parents
<html> <head> <style> div .labelinput:first-child { border-top:2px solid Chartreuse; } </style> <!--from w w w . jav a 2 s . c o m--> </head> <body> <div class="one"> <div class="labelinput"> Lorem ipsum </div> <div class="labelinput"></div> <div class="labelinput"></div> </div> <div class="two"> <div class="labelinput"> Lorem ipsum </div> <div class="labelinput"></div> <div class="labelinput"></div> </div>Lorem <div class="seventeen"> <div class="labelinput"> Lorem ipsum </div> <div class="labelinput"></div> <div class="labelinput"></div> </div> </body> </html>