Skip to content

Instantly share code, notes, and snippets.

@owngeek
Last active January 25, 2017 21:35
Show Gist options
  • Save owngeek/7dfa3905bbe17c2e161f94d9d6e3435b to your computer and use it in GitHub Desktop.
Save owngeek/7dfa3905bbe17c2e161f94d9d6e3435b to your computer and use it in GitHub Desktop.
CSS3 Gradient hover Transition
.box{ width:300px; height:300px; background-color:#30F; -webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;}
.box:hover{ background-color: #ff007c;
background-color: rgba(255,0,124,0.5);
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(9,157,179,0.6)), to(transparent));
background-image: -webkit-linear-gradient(top, rgba(9,157,179,0.6), transparent);
background-image: -moz-linear-gradient(top, rgba(9,157,179,0.6), transparent);
background-image: -o-linear-gradient(top, rgba(9,157,179,0.6), transparent);
background-image: linear-gradient(to bottom, rgba(9,157,179,0.6),transparent);
}
Copy link

ghost commented Jan 25, 2017

It's cool! but i guess it won't work on image hover?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment