I am using a :focus pseudo-class for my buttons (when pressed). It works fine on Firefox but it doesn’t change its state in Chrome. Is there any workaround?
CSS:
.btn:focus {
box-shadow: 1px 1px 1px #586601 inset;
text-shadow: -1px -1px 1px #000000;
}
(It’s an input tag with a class “btn”.)
You need to distinguish between
:focusand:active, see documentation.You should change your styles to:
DEMO