HTML CSS examples for CSS Widget:UL Element
Target first level <li> by using nested rules
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .header-menu>li a { color:Chartreuse; } .header-menu li li a { color:yellow; } </style> <!--from www . ja v a2 s .c o m--> </head> <body> <ul class="header-menu"> <li class="header-menu__item"> <a href="index.html">Lore</a> </li> <li class="header-menu__item header-menu__item--split"> <a href="menu.html">Lore</a> </li> <li class="header-menu__item"> <a href="#">Lorem ip</a> <ul class="header-menu--dropdown"> <li> <a href="menu.html">Lore</a> </li> </ul> </li> </ul> </body> </html>