Created
February 23, 2012 16:39
-
-
Save gadgetto/1893667 to your computer and use it in GitHub Desktop.
Dual color changing link by CSS3 transition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Dual color changing link by CSS3 transition | |
*/ | |
h1 { /* only for decoration */ | |
background-color: #2d2d2d; | |
padding: 30px; | |
text-align: center; | |
font-family: sans-serif; | |
} | |
h1 a, | |
h1 a:link, | |
h1 a:visited { | |
color: #fff; | |
text-decoration: none; | |
transition: color 0.5s linear; | |
} | |
h1 a:hover { | |
color: #9ec41a; | |
text-decoration: none; | |
} | |
h1 a span, | |
h1 a:link span, | |
h1 a:visited span { | |
color: #9ec41a; | |
transition: color 0.5s linear; | |
} | |
h1 a:hover span { | |
color: #fff; | |
text-decoration: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- content to be placed inside <body>…</body> --> | |
<h1><a href="#"><span>Left changes color</span> with right part</a></h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment