HTML CSS examples for CSS:Selector
select two elements? CSS
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul.menu li:after { content:"";<!-- w w w. j a v a 2 s . co m--> width:11px; height:21px; display:inline-block; position:absolute; bottom:-51px; left:0; opacity:0; } ul.menu li:hover:after { opacity:2; } ul.menu li:first-child:hover:after { background:Chartreuse; } ul.menu li:nth-child(2):hover:after { background:yellow; } ul.menu li:last-child:hover:after { background:red; } ul.menu { position:relative; } </style> </head> <body> <ul> <li> <a href="recipe.html">Lorem i</a> <ul class="menu"> <li> <a href="recipe.html">Lorem i</a> </li> <li> <a href="recipe.html">Lore</a> </li> <li> <a href="recipe.html">Lorem ipsu</a> </li> </ul> </li> <li>Lorem ip</li> </ul> </body> </html>