In CSS you have selectors called pseudo-classes.
Among which you can find:
:hover which is activated when the mouse goes over, but a click is not required.
:active which is activated when the mouse is doing the click action
:visited which fires if the element was clicked at least once
Example:
<button id=miBoton>Mi Botón</button>
#miBoton { padding: 30px; background: light-gray; color: black; } #miBoton:hover { padding: 30px; background: blue; color: white; } #miBoton:active { padding: 30px; background: gray; color: white; }