Skip to content

Instantly share code, notes, and snippets.

@owngeek
Created September 21, 2016 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owngeek/c4c3010f71ae249ca790df070654b3d8 to your computer and use it in GitHub Desktop.
Save owngeek/c4c3010f71ae249ca790df070654b3d8 to your computer and use it in GitHub Desktop.
Simple CSS3 Button Effect
<style>
.btn
{
text-transform: uppercase;
letter-spacing: 2px;
text-align: center;
color: #0C5;
font-size: 24px;
font-family: "Nunito", sans-serif;
font-weight: 300;
margin: 5em auto;
position: absolute;
top:0; right:0; bottom:0; left:0;
padding: 20px 0;
width: 220px;
height:30px;
background:#FF5722;
border: 1px solid #FF5722;
color: #FFF;
overflow: hidden;
transition: all 0.5s;
}
.btn:hover, .btn:active
{
text-decoration: none;
color: #FF5722;
border-color: #FF5722;
background: #FFF;
}
.btn span
{
display: inline-block;
position: relative;
padding-right: 0;
transition: padding-right 0.5s;
}
.btn span:after
{
content: ' ';
position: absolute;
top: 0;
right: -18px;
opacity: 0;
width: 10px;
height: 10px;
margin-top: -10px;
background: rgba(0, 0, 0, 0);
border: 3px solid #FFF;
border-top: none;
border-right: none;
transition: opacity 0.5s, top 0.5s, right 0.5s;
transform: rotate(-45deg);
}
.btn:hover span, .btn:active span
{
padding-right: 30px;
}
.btn:hover span:after, .btn:active span:after
{
transition: opacity 0.5s, top 0.5s, right 0.5s;
opacity: 1;
border-color: #FF5722;
right: 0;
top: 50%;
}
</style>
<a href="#" class="btn">
<span>Hover Me</span>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment