You can turn the element into a button.
remove default styling from a button:
online: none;
border: none;
background: none;
then apply the usual button :focus or :active selectors.
Here is example:
HTML:
<button>test1</button>
<button>test2</button>
<button>test3</button>
CSS:
button{
width: 100px;
height: 100px;
background: lightgray;
outline: none;
border: none;
}
button:hover{
color: red;
cursor: pointer;
}
button:focus, button:active{
background-color: pink;
color: white;
}
here is codepen for this: https://codepen.io/dmitrisan/pen/PomdRBG
REMEMBER: You can turn a BUTTON into a div or span tag, via CSS rules, but all BUTTON pseudo-selectors will still apply.
PROGRAMING IS EPIC! You make the RULES! =)