Dropdown list displaying - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Dropdown list displaying

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">
.top ul {
   padding:0;
   margin:0;
}

.top ul li {
   float:left;
   background-color:Chartreuse;
   width:91px;
   text-align:center;
   border-right:2px groove yellow;
}

.top ul li a {
   display:block;
   color:blue;
   font-weight:bold;
   padding:34px 11px;
}

.top ul li a:hover {
   background-color:pink;
   transition:all 0.91s;
}

ul li ul li {
   display:none;
}

ul li:hover ul li {
   display:block;
   position:relative;
}

.clear {
   clear:both;
}
</style> <!--  w w  w.j av  a2 s  .c  o  m-->
 </head> 
 <body> 
  <nav class="top"> 
   <ul> 
    <li> <a href="http://www.nba.com">Lore</a> </li> 
    <li onclick="changeP()"> <a href="#">Lorem</a> </li> 
    <li onmouseover="newText()"> <a href="#">Lorem i</a> 
     <ul> 
      <li> <a href="#">Lorem</a> </li> 
      <li> <a href="#">Lore</a> </li> 
      <li> <a href="#">Lorem ipsum </a> </li> 
      <li> <a href="#">Lorem ip</a> </li> 
     </ul> </li> 
    <li onclick="slow()"> <a href="#">Lore</a> </li> 
   </ul> 
   <div class="clear"></div> 
   <br> 
   <br> 
   <div>
     Lorem ipsum dolor sit amet, consectetur 
   </div> 
   <div>
     Lorem ipsum dolor sit amet, consectetur 
   </div> 
   <div>
     Lorem ipsum dolor sit amet, consectetur 
   </div> 
   <div>
     Lorem ipsum dolor sit amet, consectetur 
   </div> 
  </nav>  
 </body>
</html>

Related Tutorials