<style> .green {background: green} .green:hover {background: red} </style> <div class="green">over</div>