HTML CSS examples for CSS Selector:nth-child
Do a conditional nth-child
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul>li { color:Chartreuse; } ul>li[attrName="active"]~li { color:yellow; } </style> <!--from w w w .j a va 2 s . c om--> </head> <body> <ul> <li>Lorem</li> <li>Lorem</li> <li attrname="active">Lorem</li> <li>Lorem</li> <li>Lorem</li> </ul> </body> </html>