Create drop down menu with highlight - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Create drop down menu with highlight

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">

.nav-wrap {<!--from   w  w w  . ja  va 2s.co  m-->
   max-width: 700px;
   margin: 0 auto;
   background-color: #718373;
   height: 80px;
   text-transform: uppercase;
}
.dropdown {
   display: none;
   padding: 0;
   margin: 0;
   position: absolute;
   top: 100%;
   left: 0;
}
.dropdown li a {
   width: 110px;
   height: 40px;
   line-height: 40px;
   margin: 0 auto;
   padding: 5px 10px;
}
.nav-list {
   margin: 0;
   padding: 0;
}
.nav-list li {
   position: relative;
   list-style: none;
   float: left;
   width: 150px;
   line-height: 80px;
   text-align: center;
   background-color: #718373;
}
.nav-list li a {
   text-decoration: none;
   color: white;
   display: block;
}
.nav-list li:hover>.dropdown {
   display: block;
}
.dropdown li a:hover {
   border: 2px solid white;
}
.nav-list li ul li:last-child {
   padding-bottom: 15px;
}


      </style> 
 </head> 
 <body> 
  <nav> 
   <div class="nav-wrap"> 
    <ul class="nav-list"> 
     <li> <a href="#">about</a> 
      <ul class="dropdown"> 
       <li> <a href="#">hello</a> </li> 
       <li> <a href="#">hello</a> </li> 
       <li> <a href="#">hello</a> </li> 
       <li> <a href="#">hello</a> </li> 
      </ul> </li> 
     <li> <a href="#">about</a> </li> 
     <li> <a href="#">about</a> </li> 
     <li> <a href="#">about</a> </li> 
    </ul> 
   </div> 
  </nav>  
 </body>
</html>

Related Tutorials