开发者

input[type="submit"] - change background when clicked

开发者 https://www.devze.com 2023-01-08 04:59 出处:网络
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

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?


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)


input[type="submit"]:active {
    color: green;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消