Skip to content

Instantly share code, notes, and snippets.

@sanjaybhowmick
Created September 9, 2015 17:11
Show Gist options
  • Save sanjaybhowmick/6aceb9af9ac41e03f87d to your computer and use it in GitHub Desktop.
Save sanjaybhowmick/6aceb9af9ac41e03f87d to your computer and use it in GitHub Desktop.
Transitional mouse hover effect in CSS
<div id="effect">
<p><a href="#"><span>Normal text effect</span></a></p>
</div>
a, a:visited {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
#effect {
width:200px;
height:96px;
}
#effect p {
color:#fff;
letter-spacing:-1px;
text-align:center;
font-size:12px;
line-height:15px;
margin:30px 0 0 0;
}
#effect p span {
display:block;
font-weight:700;
font-size:17px;
letter-spacing:0px;
}
#effect p a,
#effect p a:visited {
background:#00adef;
padding:10px 0;
display:block;
text-decoration:none;
color:#fff;
}
#effect p a:hover {
background:#ef004d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment