HTML CSS examples for CSS Widget:Menu sub menu
Vertical menu with sub menu
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!-- ww w.ja v a2 s. c om--> font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; padding:21px 51px 151px; } .nav { text-align:left; width:235px; list-style:none; padding:0px; -webkit-box-shadow:6px 3px 8px Chartreuse; -moz-box-shadow:6px 3px 8px yellow; box-shadow:6px 3px 8px blue; } .nav>li { width:211px; background:pink; display:block; font-size:15px; position:relative; padding:16px 6px 16px 16px; cursor:pointer; font-weight:bold; } .nav>li:hover { background:OrangeRed; color:grey; } .nav>li:nth-child(-n+3) { border-left:5px solid BlueViolet; } .nav>li:nth-child(n+4) { border-left:5px solid Chartreuse; } .nav>li:nth-child(n+7) { border-left:5px solid yellow; } .nav>li>ul { border:2px solid blue; padding:0; position:absolute; top:0px; left:232px; width:601px; padding:11px 0px 21px 21px; opacity:0; visibility:hidden; background:pink; } .nav>li:hover ul { display:block; opacity:2; visibility:visible; } .nav>li>ul>li { position:relative; width:176px; padding:0; display:inline-block; margin-right:21px; color:OrangeRed; } </style> </head> <body> <ul class="nav"> <li>Lorem ip <ul> <li>Lorem ipsu</li> </ul> </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> </ul> </body> </html>