Submenu on nav - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu sub menu

Description

Submenu on nav

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 ul {<!--from   w w w  .j  a v a 2 s .  c o m-->
   list-style:none;
   background-color:Chartreuse;
   text-align:center;
   padding:0;
   margin:0;
}

.nav li {
   font-family:'Oswald', sans-serif;
   font-size:2.3em;
   line-height:41px;
   text-align:left;
}

.nav a {
   text-decoration:none;
   color:yellow;
   display:block;
   padding-left:16px;
   border-bottom:2px solid blue;
   transition:.4s background-color;
}

.nav a:hover {
   background-color:pink;
}

.nav a.active {
   background-color:OrangeRed;
   color:grey;
   cursor:default;
}

.nav li li {
   font-size:.9em;
}

@media screen and (min-width: 650px)  {
   .nav li {
      width:131px;
      border-bottom:none;
      height:51px;
      line-height:51px;
      font-size:2.5em;
      display:inline-block;
      margin-right:-5px;
   }
   
   .nav a {
      border-bottom:none;
   }
   
   .nav>ul>li {
      text-align:center;
   }
   
   .nav>ul>li>a {
      padding-left:0;
   }
   
   .nav li ul {
      position:absolute;
      display:none;
      width:inherit;
   }
   
   .nav li:hover ul {
      display:block;
   }
   
   .nav li ul li {
      display:block;
   }

}
</style> 
 </head> 
 <body> 
  <div class="nav"> 
   <ul> 
    <li> <a href="#home">Lore</a> </li> 
    <li> <a href="#about">Lorem</a> 
     <ul> 
      <li>Lorem </li> 
      <li>Lorem </li> 
     </ul> </li> 
    <li> <a href="#credo">Lorem</a> </li> 
    <li> <a href="#philosophy">Lorem ipsu</a> </li> 
    <li> <a href="#portfolio">Lorem ips</a> </li> 
    <li> <a href="#services">Lorem ip</a> </li> 
    <li> <a href="#news">Lore</a> </li> 
    <li> <a href="#contact">Lorem i</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials