HTML CSS examples for CSS Selector:nth-of-type
CSS selector: :nth-of-type(2)
<html> <head> <title>Lorem ipsum dolo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div.pair:nth-of-type(2) { color:Chartreuse; background:yellow; } div.pair:nth-of-type(3) { color:blue; background:pink; } </style> <!--from w ww. ja va2 s . c o m--> </head> <body> <div class="h2 colors"> Lorem ipsum dol </div> <div class="pair"> Lorem ipsum d </div> <div class="pair"> Lorem ipsum d </div> <div class="pair"> Lorem ipsum d </div> <div class="pair"> Lorem ipsum d </div> </body> </html>