Jump to content

the hover background color of the sub menu is not changing.


sayed2x2
 Share

Recommended Posts

Hi, I was modifying the drop-down menu and got stuck at one point. I want to change the hover color of the sub-menu to pink( The same tab color) however its picking up the border-backgournd color which is blue(#C39). Any help?Thanks in advance. ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Here is the code------------------------------------------------------ <!DOCTYPE html><html><head> <style> #cssmenu{border:1px solid;border-radius:5px;height:40px;margin:20px auto;padding:0px;display:block;width:400px; } #cssmenu>ul{list-style:inside none;padding:0px;margin:0px; } #cssmenu > ul > li{list-style:inside none;float:right;display:block;position:relative;padding:0px;margin:0px; } #cssmenu>ul>li>a{ouline:none;display:block;position:relative;margin:9px 20px;padding:12px 20px;text-align:center;text-decoration:none;font:bold 16px/100% Arial, Helvetica, sans-serif; text-shadow:1px 1px 0 rgba(0,0,0, 0.4);color:#FFF;margin:-4px;} #cssmenu > ul > li:first-child > a{border-radius:5px 0 0 5px;} }#cssmenu ul li.has-sub:hover > a:after{top:0; bottom:0;} #cssmenu ul li.has-sub:hover > a{ background: #C39; border-color:#FFF; padding-bottom:13px; padding-top:13px; top:-1px; z-index:999; } #cssmenu ul li.has-sub:hover > ul, #cssmenu ul li.has-sub:hover > div{display:block;} #cssmenu ul li.has-sub > a:hover{background:#C39; border-color:#FFF;} #cssmenu ul li > ul, #cssmenu ul li > div{ display:none; width:auto; position:absolute; top:38px; padding:10px 0; background: #CCC; border-radius:0 0 5px 5px; z-index:999; } #cssmenu ul li > ul{width:200px;} #cssmenu ul li > ul li{display:block; list-style:inside none; padding:0; margin:0; position:relative;} #cssmenu ul li > ul li a{ outline:none; display:block; position:relative; margin:0; padding:8px 20px; font:10pt Arial, Helvetica, sans-serif; color: #FFF; text-decoration:none; text-shadow } /*Border color*/#cssmenu, #cssmenu > ul > li > ul > li a:hover{ background: #003; } #cssmenu{border-color:#647306;} /*border color ends here*/ #cssmenu > ul > li > a:after{border-color;#FFF;} #cssmenu > ul > li > a:hover{background: #C39;} </style></head> <body> <div id='cssmenu'><ul><li class='active '><a href='index.html'><span>Contact us</span></a></li><li class='has-sub '><a href='#'><span>Products</span></a><ul><li><a href='#'><span>Product 1</span></a></li><li><a href='#'><span>Product 2</span></a></li></ul></li><li><a href='#'><span>About Us</span></a></li><li><a href='#'><span>Home</span></a></li></ul></div> </body></html>

  • Like 1
Link to comment
Share on other sites

I think this is what your after......

<!DOCTYPE html><html><head><title>Your Page</title><style>#cssmenu{	 border:1px solid;	 border-radius:5px;	 height:40px;	 margin:20px auto;	 padding:0px;	 display:block;	 width:400px;}#cssmenu>ul{list-style:inside none;	 padding:0px;	 margin:0px;}#cssmenu > ul > li{list-style:inside none;	 float:right;	 display:block;	 position:relative;	 padding:0px;	 margin:0px;}#cssmenu>ul>li>a{	 ouline:none;	 display:block;	 position:relative;	 margin:9px 20px;	 padding:12px 20px;	 text-align:center;	 text-decoration:none;	 font:bold 16px/100% Arial, Helvetica, sans-serif;	 text-shadow:1px 1px 0 rgba(0,0,0, 0.4);	 color:#FFF;	 margin:-4px;}#cssmenu > ul > li:first-child > a{	 border-radius:5px 0 0 5px;}#cssmenu ul li.has-sub:hover > a:after{	 top:0; bottom:0;}#cssmenu ul li.has-sub:hover > a{	 background: #C39;	 border-color:#FFF;	 padding-bottom:13px;	 padding-top:13px;	 top:-1px;	 z-index:999;}#cssmenu ul li.has-sub:hover > ul, #cssmenu ul li.has-sub:hover > div{	 display:block;}#cssmenu ul li.has-sub > a:hover{	 background:#C39;	 border-color:#FFF;}#cssmenu ul li > ul, #cssmenu ul li > div{	 display:none;	 width:auto;	 position:absolute;	 top:38px;	 padding:10px 0;	 background: #CCC;	 border-radius:0 0 5px 5px;	 z-index:999;}#cssmenu ul li > ul{	 width:200px;}#cssmenu ul li > ul li{	 display:block;	 list-style:inside none;	 padding:0;	 margin:0;	 position:relative;}#cssmenu ul li > ul li a{	 outline:none;	 display:block;	 position:relative;	 margin:0;	 padding:8px 20px;	 font:10pt Arial, Helvetica, sans-serif;	 color: #FFF; text-decoration:none;	 text-shadow:;	                                 /* What's your plans for text shadow??? */}/*Border color*/#cssmenu, #cssmenu > ul > li > ul > li a:hover{	 background: #003;}#cssmenu{	 border-color:#647306;}/*border color ends here*/#cssmenu > ul > li > a:after{	 border-color;#FFF;}#cssmenu > ul > li > a:hover{	 background: #C39;}#cssmenu ul > li > ul > li{	 background: #003;}#cssmenu ul > li > ul > li > a:hover{	 background: #C39;}</style></head><body>	 <div id='cssmenu'>		  <ul>			   <li class='active '><a href='index.html'><span>Contact us</span></a></li>			   <li class='has-sub '><a href='#'><span>Products</span></a>					<ul>						 <li><a href='#'><span>Product 1</span></a></li>						 <li><a href='#'><span>Product 2</span></a></li>					</ul>			   </li>			   <li><a href='#'><span>About Us</span></a></li>			   <li><a href='#'><span>Home</span></a></li>		  </ul>	 </div></body></html>

Link to comment
Share on other sites

try this one.....

<!DOCTYPE html><html><head><style>#cssmenu{border:1px solid;border-radius:5px;height:40px;margin:20px auto;padding:0px;display:block;width:400px;}#cssmenu>ul{list-style:inside none;padding:0px;margin:0px;}#cssmenu > ul > li{list-style:inside none;float:right;display:block;position:relative;padding:0px;margin:0px;}#cssmenu>ul>li>a{ouline:none;display:block;position:relative;margin:9px 20px;padding:12px 20px;text-align:center;text-decoration:none;font:bold 16px/100% Arial, Helvetica, sans-serif;text-shadow:1px 1px 0 rgba(0,0,0, 0.4);color:#FFF;margin:-4px;}#cssmenu > ul > li:first-child > a{border-radius:5px 0 0 5px;} }#cssmenu ul li.has-sub:hover > a:after{top:0; bottom:0;} #cssmenu ul li.has-sub:hover > a{background: #C39;border-color:#FFF;padding-bottom:13px;padding-top:13px;top:-1px;z-index:999; }#cssmenu ul li.has-sub:hover > ul, #cssmenu ul li.has-sub:hover > div{display:block;}#cssmenu ul li.has-sub > a:hover{background:#C39;border-color:#FFF;}#cssmenu ul li > ul, #cssmenu ul li > div{display:none;width:auto;position:absolute;top:37px;padding:10px 0;background: #CCC;border-radius:0 0 5px 5px;z-index:999; }#cssmenu ul li > ul{width:200px;}#cssmenu ul li > ul li{display:block;list-style:inside none;padding:0;margin:0;position:relative;}#cssmenu ul li > ul li a{outline:none;display:block;position:relative;margin:0;padding:8px 20px;font:10pt Arial, Helvetica, sans-serif;color: #FFF; text-decoration:none;text-shadow }/*Border color*/#cssmenu, #cssmenu > ul > li > ul > li a:hover{background: #003;}#cssmenu{border-color:#647306;}/*border color ends here*/#cssmenu > ul > li > a:after{border-color;#FFF;}#cssmenu > ul > li > a:hover{background: #C39;}#cssmenu > ul > li > ul > li a:hover{background: #CC3399;} </style></head><body><div id='cssmenu'><ul><li class='active '><a href='index.html'><span>Contact us</span></a></li><li class='has-sub '><a href='#'><span>Products</span></a><ul><li><a href='#'><span>Product 1</span></a></li><li><a href='#'><span>Product 2</span></a></li></ul></li><li><a href='#'><span>About Us</span></a></li><li><a href='#'><span>Home</span></a></li></ul></div> </body></html>

Edited by manojnaanak
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...