Create dropdown tab on mouse hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Create dropdown tab on mouse hover

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

#contentBox { position: relative; font-size: 80%; }
#contentBox > li
{
   display: inline;
   padding: 6px;
   margin: 0 1px;
   cursor: pointer;
}
#contentBox > li:hover, #contentBox ul
{
   border: 1px solid #CCC;
   background-color: #FFF;
}
#contentBox > li:hover {
   border-bottom-color: #FFF;
}
#contentBox > li:hover ul
{
   position:absolute;
   z-index:-99;<!--from w  ww  .  j ava2  s.  c o  m-->
   display: block;
   margin-top:5px;
}
#contentBox ul
{
   position: absolute;
   display: none;
   border-width: 1px;
   width: 500px;
   padding: 6px;
   cursor: default;
   margin-top: 6px;
   z-index: -1;
}


      </style> 
 </head> 
 <body> 
  <ul id="contentBox"> 
   <li> Go 
    <ul> 
     <li> <h1> test test test test test test test </h1> Lorem ipsum dolor sit amet. </li> 
    </ul> </li> 
   <li> Messages 
    <ul> 
     <li> <h1> test test test test test test test </h1> Lorem ipsum dolor sit amet. </li> 
    </ul> </li> 
   <li> Assets 
    <ul> 
     <li> <h1> test test test test test test test </h1> Lorem ipsum dolor sit amet. </li> 
    </ul> </li> 
   <li> Support 
    <ul> 
     <li> <h1> test test test test test test test? </h1> Lorem ipsum dolor sit amet, consetetur sadipscing elitr. </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials