tags:

views:

24

answers:

2

Hi, I make link buttons on sidebar of a web page. It will change color if I click the button. It works well in IE6 but not Firefox. Anyone can advise me how to make it on in FF. Million thanks.

Here are parts in css and html body:

.sidenav li a:active {
    background: #cff;
    color: blue;


}

....

<div class="sidenav">
<ul>
    <li><a href="..." ></a></li>
</ul>
+2  A: 

It depends what you are trying to achieve.

Do you want it to be coloured when the user hovers over it? Or change colour permanently once they have clicked it?

Try using a:visited or a:hover.

DanieL
I want to change color when user click it so user knows which section is on.
aladine
A: 

a:active is a link that has not been clicked yet. Once you click it, it's categorized under a:visited. a:hover, as implied, is a category for links hovered over.

Most of the time you should have a:active and a:visited styled the same way, unless you want to distinguish between previously clicked links and other unclicked links.

msakr
I try both but the effect is visible in IE6 but not FF. It is very weird that IE6 understand the style better in this case than FF.
aladine