Skip to content

Instantly share code, notes, and snippets.

@richthegeek
Created March 5, 2012 22:33
Show Gist options
  • Save richthegeek/1981639 to your computer and use it in GitHub Desktop.
Save richthegeek/1981639 to your computer and use it in GitHub Desktop.
Make an input retain a style after it's clicked/hovered using transitions
div {
background: #f00;
-webkit-transition: background 1000s linear;
-moz-transition: background 1000s linear;
transition: background 1000s linear;
}
div:hover {
background: #00f;
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment