Option 1: Javascript Solution
Just add a class that prohibits the use of the hover style when pressed:
$('div').on('click', function() {
div { color: blue; } div:not(.no-hover):hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div>hover!</div>
Option 2: CSS Solution
Alternatively, in pure CSS (although without preserving the rules)
div { color: blue; } div:not(:focus):hover { color: red; } div:focus { outline: none; }
<div tabindex="0">hover!</div>
source share