CSS menu hover colors and background colors - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Hover

Description

CSS menu hover colors and background colors

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">
.menu-product-categories-container {
   display:block;
   width:100%;
   height:61px;
   background:Chartreuse;
}

#menu-product-categories {
   list-style:none;
   padding:0;
   margin:0;
   text-align:center;
   height:100%;
   z-index:0;<!--from   w  w  w  .ja  v  a  2  s  .co  m-->
}

#menu-product-categories>li {
   display:inline-block;
   z-index:10000;
   position:relative;
   padding:22px 9px;
   text-decoration:none;
}

#menu-product-categories li>a {
   display:block;
}

#menu-product-categories>li:hover {
   background:yellow;
   color:blue;
}

#menu-product-categories>li>a {
   color:pink;
}

#menu-product-categories>li:hover>a {
   color:OrangeRed;
}

#menu-product-categories ul.sub-menu {
   list-style:none;
   padding:0;
   margin:0;
   display:none;
   width:201px;
   position:absolute;
   z-index:2;
   left:0;
   top:61px;
   background:grey;
}

#menu-product-categories li:hover ul.sub-menu {
   display:block;
   max-height:201px;
   background:BlueViolet;
}

#menu-product-categories ul.sub-menu li {
   color:Chartreuse;
   padding:6px;
}

#menu-product-categories ul.sub-menu li:hover {
   color:yellow;
   background:blue;
   float:none;
   padding:6px;
}
</style> 
 </head> 
 <body> 
  <div class="menu-product-categories-container"> 
   <ul id="menu-product-categories" class="menu"> 
    <li id="menu-item-2933" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat current-menu-item menu-item-2933"> <a href="/shop/product-category/desk-phones/">Lorem ipsum</a> </li> 
    <li id="menu-item-2934" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2934"> <a href="/shop/product-category/headsets/">Lorem ip</a> </li> 
    <li id="menu-item-2931" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2931"> <a href="/shop/product-category/conference-phones/">Lorem ipsum dolor</a> </li> 
    <li id="menu-item-2932" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2932"> <a href="/shop/product-category/dect-phones/">Lorem ipsum</a> </li> 
    <li id="menu-item-2935" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2935"> <a href="/shop/product-category/routers/">Lorem i</a> </li> 
    <li id="menu-item-2936" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2936"> <a href="/shop/product-category/switches/">Lorem ip</a> 
     <ul class="sub-menu"> 
      <li> <a href="#">Lorem ipsu</a> </li> 
      <li> <a href="#">Lorem ipsu</a> </li> 
      <li> <a href="#">Lorem ipsu</a> </li> 
      <li> <a href="#">Lorem ipsu</a> </li> 
     </ul> </li> 
    <li id="menu-item-2930" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat menu-item-2930"> <a href="/shop/product-category/cctv/">Lore</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials