Skip to content

Instantly share code, notes, and snippets.

@logeshpaul
Created May 24, 2013 10:25
Show Gist options
  • Select an option

  • Save logeshpaul/5642609 to your computer and use it in GitHub Desktop.

Select an option

Save logeshpaul/5642609 to your computer and use it in GitHub Desktop.
Fade Effect on Link Hover
/* Hover CSS properties */
a {
color:blue;
/* First we need to help some browsers along for this to work.
Just because a vendor prefix is there, doesn't mean it will
work in a browser made by that vendor either, it's just for
future-proofing purposes I guess. */
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
/* ...and now for the proper property */
transition:.5s;
}
a:hover { color:red; }
/* Multiple CSS properties */
a {
color:blue; background:white;
-o-transition:color .2s ease-out, background 1s ease-in;
-ms-transition:color .2s ease-out, background 1s ease-in;
-moz-transition:color .2s ease-out, background 1s ease-in;
-webkit-transition:color .2s ease-out, background 1s ease-in;
/* ...and now override with proper CSS property */
transition:color .2s ease-out, background 1s ease-in;
}
a:hover { color:red; background:yellow; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment