Text Color While Hover and Active Simulataneously

I have a vertical drop down menu. The main category link text is Color A and the background is white. On hover, text changes to Color B and the background changes to Color C. When the link is active, the text changes to Color C and background white. My problem is when I again hover the link while active, I want the background Color C and the text Color B, same sequence as hover state of inactive link. Essentially I want hover inactive link and hover active link to be the same when both are in use.

Link Inactive: Text Color A, Background White
Hover: Link Text Color B, Background Color C
Active: Link Text Color C, Background White
Hover/Active: Text Color B, Background Color C

I hope this makes sense. If anyone can tell me if this is possible I would greatly appreciate it. Below is my code, I only included relevant code:

.menu > li > a {
color: #CB6C00;
}
.menu > li > a span {
background: #FFFFFF;
}
.menu > li > a:hover {
background-color: #008590;
color: #FFFFFF;
}
.menu > li > a.active { (I want a hover here to be text #FFFFFF and background #008590, but of course text is already #008590.)
color: #008590;
}

Have you tried this?

.menu > li > a.active:[COLOR="#FF0000"]hover[/COLOR] {
  color: #fff;
  background: #008590;
}

I just tried it but did not work until I realized I didn’t change the text color in the non-hover active state. Thank you for the help!

The only way to achieve an active state without hover applying is if the keyboard has been used to give the field the focus and then the enter key pressed to make it active.

Are you sure that you are using the keyboard to tab to the field and then pressing enter in order to set the active state without first setting the hover state - which you’d do by moving the mouse over it (where you’d depress a mouse button to set it active).

Also you need to remember that it only stays active until the key is released - once you release the key it returns to the hover or focus state.

a:hover,a:active { /* rules */ }

The OP has a class of “active” applied to a menu item when it is the currently selected page. This is not an issue over the :active pseudo class. Ideally, to avoid confusion, it’s better to use a class of “current” (or similar).

a:hover,a:active,
a.active:link,a.active:visited { /* rules / }
a.active:hover,a.active:active { /
rules */ }

:wink:

Did I just respond to a 2 year old topic or are there issues with the dates just now? I’m sure I remember making my earlier post quite recently. Either that or I’m losing my mind.

Prior to your first reply, the last was made Nov 2012 by @ralphm

There is a pop-up to let you know, but does anybody pay heed to those after they’ve seen a few?

I don’t remember seeing that notice :S