views:

47

answers:

2

Hi,

I have a simple <input type="submit" value="Search"> submit button. In the CSS i have styled it with input[type="submit"] and input[type="submit"]:hover so it changes its background by default and when hovered. Is there a way to change its background when clicked?

A: 
input[type="submit"]:active {
    color: green;
}
Matty F
Thank you so much!
stefa.rossi
+1  A: 

You should be able to use input[type=submit]:active, similar to how you'd style links.

Do note that this will not function properly in IE6 (not sure about 7 and 8)

Jani Hartikainen
Oh, I don't mind IE6-IE7 compatibilty...Thank you all, it was so simple that I forgot it :D
stefa.rossi