<!DOCTYPE HTML> <html> <head> <title>Untitled</title> <meta charset="utf-8"> <style type="text/css"> .red:hover{ animation: go 1s ease-in-out; -webkit-animation: go 1s ease-in-out; } @keyframes go { 0%{ background-color: rgb(255, 0, 0); } 100%{ background-color: transparent; } } @-webkit-keyframes go { 0%{ background-color: rgb(255, 0, 0); } 100%{ background-color: transparent; } } </style> </head> <body> <input name="" type="button" value="test" class="red"> </body> </html>