HTML CSS examples for CSS Widget:Menu Dropdown
Drop down navigation bar
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #navbar {<!-- w w w. j a v a 2 s . co m--> background:Chartreuse; position:relative; margin-top:16px; } #navbar>li { float:left; margin:0 11px; position:relative; padding:15px 0; } #navbar li a, .subnavi li a { color:yellow; text-decoration:none; display:inline-block; line-height:30px; padding:0 14px; font-size:17px; font-family:arial; text-shadow:0px 3px 3px blue; filter:dropshadow(color=pink, offx=0, offy=3); } #navbar>li:hover>a, li:hover>a , #navbar li a.active { background:OrangeRed; -webkit-border-radius:6px; -moz-border-radius:6px; border-radius:6px; -webkit-box-shadow:inset 0px 4px 4px 0px grey; -moz-box-shadow:inset 0px 4px 4px 0px BlueViolet; box-shadow:inset 0px 4px 4px 0px Chartreuse; border:2px solid yellow; color:blue; line-height:28px; padding:0 13px; } .subnavi { position:absolute; display:none; top:52px; -webkit-border-radius:6px; -moz-border-radius:6px; border-radius:6px; -webkit-box-shadow:0px 0px 4px 2px pink; -moz-box-shadow:0px 0px 4px 2px OrangeRed; box-shadow:0px 0px 4px 2px grey; background:BlueViolet; border:2px solid Chartreuse; padding:11px 0; white-space:nowrap; } #navbar li:hover .subnavi { display:block; } #navbar .subnavi li { margin:0; } #navbar .subnavi li a { display:block; font-size:14px; padding:0 16px; border-radius:0; line-height:28px; } #navbar .subnavi li a:hover { padding:0 16px; border-radius:0; border-left:0; border-right:0; line-height:26px; } #navbar:after { content:''; clear:both; display:block; overflow:hidden; } </style> </head> <body> <ul id="navbar"> <li> <a href="" class="active">Lorem</a> </li> <li> <a href="">Lore</a> <ul class="subnavi"> <li> <a href="">Lore</a> </li> <li> <a href="">Lore</a> </li> <li> <a href="">Lore</a> </li> <li> <a href="">Lore</a> </li> <li> <a href="">Lore</a> </li> </ul> </li> <li> <a href="">Lore</a> </li> </ul> </body> </html>