Menu hover issue - css

With the CSS below, I'm trying to get the hover effect to ommit the current page but it doesn't.
#access li:hover a,
#access ul ul :hover a{
background: #37617a;
}
#access ul li.current-menu-item a:hover {
background:none
}

This is probably what you want, taking #access as the id of the ul. jsfiddle test
#access li:hover a{
background: #37617a; }
#access li.current-menu-item a{
background:none }

Related

How to stay hover color after pressed

I'm using sahifa theme.I set special css for each buton on main menu.But something block my code and it's back to orjinal theme color blue.
I tried every rules
/* Altinci Menu */
.altinci-nav{
/*background-color: #866;*/
}
.altinci-nav:hover {
background-color: #8c5de4;
}
/*ul li.altinci-nav a,*/
.altinci-nav ul li a:hover,
.altinci-nav ul li a,
.altinci-nav ul li:hover > a,
.altinci-nav ul li:active,
ul li.altinci-nav:active{
background-color: #8c5de4;
}
.altinci-nav:active {
background-color: #8c5de4;
}
.altinci-nav:focus {
background-color: #8c5de4;
}
.altinci-nav:select{
background-color: #8c5de4;
}
.altinci-nav:after{
background-color: #8c5de4;
}
I look with firefox web developer tools and it's show problem that.
#main-nav ul li.current-menu-item a,
#main-nav ul li.current-menu-item a:hover
So I make comment this lines bu nothing change
UPDATE
#main-nav ul li.current-menu-item a,
#main-nav ul li.current-menu-item a:hover{ background-color: transparent !important; }
Thank you.Claudiu D.
find your .altinci-nav:hover css rule and add a chained one for the current page like this
.altinci-nav:hover,
.altinci-nav.current-menu-item {
do the same for other links

List mouse over not working

The main header menu of my site has an hover effect.But when i mouse over to the right of each menu item the text color is not changing but when i mouse over near the text it changes.
I have tried
.menu li:hover{background:#222;
color:white;}
.menu a:hover{
color:white;
}
but this didn't work.work. Please Help to make the hover effect.Thank you
try this,i think its compelete:
.menu li:hover{
background:#000;
}
.menu li a:link,
.menu li a:visited{
color:#000;
}
.menu li:hover a{
color:#FFF;
}
You need to change the color of the anchor's text when hovering over the li. Therefore use the following:
.menu li:hover a {
color: #fff;
}
Change it to this:
.menu li:hover{
background:#222;
color:white
}
.menu li:hover a{
color:white;
}
Try this,
.menu li:hover{
background:#222;
}
.menu li:hover a{
color:white;
}
This may be because your anchor has already css defined for itself. you need to override them.

CSS drop down menu won't center, despite usual tricks

Having a devil of a time getting my CSS dropdown menu to center. I know this is question has been asked before, but their solutions don't seem to be working. I've tried the margin:auto trick, changed the float:left to display:inline-block, and tried to put it in an invisible, centered superlayer. Nothing helped. :) What am I missing?
.nav ul ul {
display:none;
}
.nav ul li:hover > ul {
display:block;
}
.nav ul {
display:inline-block;
position: absolute;
padding: 0;
margin-left:auto;
margin-right:auto;
margin-top:0;
margin-bottom:0;
background:#fff8e0;
font-family: hofstad;
font-size:30px;
color:#6f0018;
padding-top:20;
padding-bottom:20;
list-style-type: none;
}
.nav ul li {
float:left;
margin-left:50;
margin-right:50;}
.nav ul li a {
;} !--main links, if they are links--!
.nav ul li:hover {
color:#980122;
}
.nav ul li:hover > ul {
margin:0;
padding-top:20;
padding-bottom:0;
padding-left:0;
padding-right:0;
}
.nav ul li:hover > ul li {
float:none;
margin-left:0;
margin-right:0;
padding-top:0;
padding-bottom:5;
padding-left:5;
padding-right:5;
}
.nav ul li:hover > ul li a {
color:#980122;
}
.nav ul li:hover > ul li a:hover {
color:#6f0018;
}
Its a little hard without seeing it in action to debug.
But it looks initially like your UL is positioned as "absolute" as soon as you do that it is pulled out of the main document flow.
Try playing around with which parent element has a "relative" position for it to anchor to.

Style Unordered List Independently From Parent Unordered List

I'm not sure if I formulated the question correctly, but let me try to explain what I want to achieve.
I'm trying to style navigation menu of a WordPress-based site.
I want the submenu links to be evenly arranged along the entire width of the website's <body> tag (960px wide). If the links of a particular submenu do not fit in one row, I want them to wrap around and arrange themselves in neat columns.
Finally, I want the submenu, when it drops down on hover, to push the rest of the website's content down.
Problem: the submenu unordered list affects the position of the links in the parent unordered list, moving the links around. Somehow, the only thing I could do to keep the parent menu links in place was to pull the submenus out of the way by applying margin-right:-965px;
Question: How should I modify my CSS to position both submenus all the way to the left, level with the edge of the main container?
(If necessary, I can assign custom classes to each submenu separately, for example: .submenu-about and .submenu-investors.)
Thank you in advance for your help!
Here's the complete CSS for the navigation menu:
.main-navigation ul {
list-style-type:none;
margin-top:45px;
}
.main-navigation ul {
display: inline-block;
width:70%;
float:right;
}
.main-navigation ul li {
float:left;
}
.main-navigation ul li a {
display:block;
margin:3px 0 3px 40px;
}
.main-navigation ul ul {
background:#efefef;
display:none;
}
.main-navigation li {
font-size: 13px;
}
.main-navigation li a {
outline: none;
text-decoration:none;
border-bottom: 0;
color: #6a6a6a;
text-transform: uppercase;
//white-space: nowrap;
}
.main-navigation li a:hover {
color: #000;
}
.main-navigation ul li:hover > ul {
margin:-1px -960px 3px 0;
display:block;
width:960px;
}
.main-navigation li ul li a {
font-size: 11px;
margin: 10px 0 10px 10px;
width:180px;
}
.main-navigation .menu-item > a,
.main-navigation .menu-ancestor > a,
.main-navigation .page_item > a,
.main-navigation .page_ancestor > a {
color: #9a9a9a;
font-weight:bold;
}
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
color: #636363;
font-weight:bold;
}
This Should do it
Add this to your css
.main-navigation ul li .sub-menu {position:absolute; left:0px;}
Found my own answer.
Remove the background from ul li:hover ul.
Set position:relative and the gray background for the ul li:hover >ul li.
Set individually the negative left margins for each submenu li item, to pull them left separately by different number of pixels.

styling Submenu CSS

Im trying to style the submenu on my wordpress menu
http://www.milknhny.co.uk/SofiaWork/
I tried
.headermenu ul ul
etc,... and it didnt work, can anyone suggest the correct class structure?
ive already tried
.headermenu ul li ul li also
thanks
Your ul's got an id attribute. Why not use it in css:
#menu-header-menu - I think it is the top-level menu.
#menu-header-menu .sub-menu - targets ALL sub menus of top-level menu.
Not sure what you are trying to customise, but the anchor text also has a background which does not help styling, so if you remove this it can help you style the list item better.
#headermenu ul ul li a {
background: none;
}
#headermenu ul ul li a:hover, ul.headermenu ul ul li:hover {
background: none;
}
Then use :
#headermenu ul ul li {
background: red ;
}
AND:
#headermenu ul ul li:hover {
background: yellow;
}

Resources