. In CSS, I stylize...">

Input [type = "submit"] - change the background when clicked

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

+4
source share
2 answers

You can use input[type=submit]:active , just like you created links.

Please note that this will not work correctly in IE6 (not sure if 7 and 8)

+11
source
 input[type="submit"]:active { color: green; } 
+4
source

Source: https://habr.com/ru/post/1316564/


All Articles