I had a hover effect on an html input element but also needed to have an active state.
The css was like this for the inputs in mention:

1
2
3
.contactformdiv input:hover, .contactformdiv textarea:hover {
  background-color:#fff;
}

It was simple, I just added a focus

1
2
3
.contactformdiv input:hover, .contactformdiv textarea:hover, .contactformdiv input:focus, .contactformdiv textarea:focus {
  background-color:#fff;
}