Home › Forums › CSS › Please Help; IE Browser Compatibility Issue › Re: Please Help; IE Browser Compatibility Issue
Your color disappears because you haven’t defined a VISITED state.
I stripped your code and only kept the relevant code for the button, and I came up with this: http://jsfiddle.net/senff/HzBjd/
In Firefox, the button turns green when you click on it, but will not go back to blue (rest state) unless you put the focus somewhere else.
In IE, the button turns green when you click on it, but it will stay green unless you actually click anywhere in the window (hence, the button will be losing the focus), and then the background will be white (because this is the :visited state, which is not defined). Also, I’m not 100% sure, but I think FOCUS is not supported by IE7 in the first place.
In Chrome, the button won’t even go green when you click on it.
In Safari, same thing.
So….
If we change “FOCUS” to “ACTIVE”, we get this: http://jsfiddle.net/senff/HzBjd/2/
This works better in most browsers. In IE7 it still keeps the focus, and IE7 treats “ACTIVE” as “FOCUS”. There is nothing you can do about this unless you want to use some Javascript. The other issue is still that IE8/IE9 go back to a white background, so we’ll have to define the “VISITED” state: http://jsfiddle.net/senff/HzBjd/3/