Any reason why when I run this code,
input[type=submit]:active {
background-color: green;
}
when I click the desired button it only flashes green for a split second and then returns to the original colour? How can I keep it permanently green?
Any reason why when I run this code,
input[type=submit]:active {
background-color: green;
}
when I click the desired button it only flashes green for a split second and then returns to the original colour? How can I keep it permanently green?
try this
You also need to use the
:focus
selector.This then adds the background color to the input as it is the focused element.