PDA

View Full Version : a:active in Foxfire not working



qtone
Oct 18th, 2008, 07:06 PM
I put my menu in a table with an ID, and each link is in a cell.
My css code is:
#nav a:active {
background-color:#FFFFFF;
}
This works in Internet Explorer 7, but in Firefox, the background color of the cell does not remain white, while on the active page.
Can this be fixed?
Thanks.

itsallkizza
Oct 18th, 2008, 11:43 PM
#nav a:active,#nav a:focus
{
background-color:#FFFFFF;
}


it's just Firefox being all rebellious and independent ;)

VIPStephan
Oct 19th, 2008, 04:39 PM
The :active pseudo class is not for “active pages” but rather for the active state of an element (an anchor in this case), i. e. the state while you hold your mouse button down when you click the element, and only for that long. One could say :active is the state the link is in as you click it.

itsallkizza
Oct 19th, 2008, 11:24 PM
Yes, that's true, I was assuming qtone knew this. :active doesn't work in FF2 though, you need to add :focus.

qtone
Oct 20th, 2008, 01:04 AM
Thanks so much itsallkissa and VIPStephan - I never used focus for a link and couldn't understand why the active worked in IE but not FF. There's always something new to learn.