HTML CSS examples for CSS Widget:Menu
Get a:active to work on menu
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html, body, div, form, fieldset, img, legend, label, li, nav, ul { margin:0; padding:0; } table {<!--from w w w. j a va 2s . c om--> border-collapse:collapse; border-spacing:0; } th, td { text-align:left; vertical-align:top; } h1, h2, h3, h4, h5, h6, th, td, caption { font-weight:normal; } img { border:0; } p, h2 { margin:0; } html { background-color:Chartreuse; } body { width:100%; height:100%; margin:0 auto; font-family:Arial,Helvetica,sans-serif; font-size:13px; letter-spacing:2.6px; } .wrapper{ } a { text-decoration:none; } a img { border:0px; text-decoration:none; } a:link, a:visited { color:yellow; text-decoration:none; } a:active { background-color:blue; } header { background-color:pink; min-width:100%; margin:0px 0px 0px 0px; float:left; height:91px; } .logo { background-color:OrangeRed; height:61px; padding-left:151px; } .menu { background-color:grey; } .menu nav { float:left; padding-left:151px; padding-bottom:9px; padding-top:9px; } .menu nav ul { list-style:none; } .menu nav ul li { display:inline; padding-right:16px; } .menu nav ul li a { padding-top:6px; padding-bottom:6px; } .menu nav ul li a:hover { color:BlueViolet; } </style> </head> <body> <div class="wrapper"> <header> <div class="logo"> <a href="#"> <img src="https://www.java2s.com/style/demo/Opera.png" alt="The Restaurant"> </a> </div> <div class="menu"> <nav> <ul> <li> <a href="food.html">Lore</a> </li> <li> <a href="#">Lore</a> </li> <li> <a href="#">Lorem i</a> </li> <li> <a href="#">Lorem ip</a> </li> <li> <a href="#">Lorem ipsum </a> </li> <li> <a href="#">Lorem ipsum d</a> </li> <li> <a href="contact.html">Lorem i</a> </li> </ul> </nav> </div> </header> </div> </body> </html>