Horizontal menu with UL - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Horizontal menu with UL

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div img {
   display:block;
   width:100%;
}

div li {
   height:31px;
   width:21%;
   background:Chartreuse;
   float:left;
   list-style:none;
}

div ul {
   margin:0;
   padding:0;
}

div nav ul li {
   list-style:none;
   float:left
}

div nav ul li a {
   text-decoration:none;<!--from  ww w .  j  ava  2  s . c o m-->
   float:left;
   display:block;
   padding:11px 21px;
   color:yellow;
}

div.nav ul li a:hover {
   color:blue;
}
</style> 
 </head> 
 <body> 
  <div class="header"> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="Smiley face"> 
  </div> 
  <div class="nav"> 
   <ul> 
    <li> <a href="#">test</a> </li> 
    <li> <a href="#">test</a> </li> 
    <li> <a href="#">test</a> </li> 
    <li> <a href="#">test</a> </li> 
    <li> <a href="#">test</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials