flapping button
button flaps rotate on :hover
by Dru Dro
HTML
<div class="button">Learn More</div>
CSS
*,
*:after,
*:before {
transition: all .25s ease-in-out;
}
html,
body {
font-family: Arial;
font-size: 62.5%;
width: 1200px;
}
.button {
display: inline-block;
position: relative;
font-size: 1.6rem;
font-weight: bold;
padding: 12px 20px;
background-color: #fff;
border-radius: 2px;
border: 2px solid #555;
cursor: pointer;
color: #555;
z-index: 0;
overflow: hidden
}
.button:hover {
color: #fff;
}
.button:before,
.button:after {
display: block;
content: "";
position: absolute;
width: 100%;
height: 300%;
background: #333;
top: -100%;
z-index: -1;
}
.button:before {
left: -100%;
}
.button:after {
right: -100%;
}
.button:hover:before {
left: -50%;
top: -150%;
transform: rotate(45deg);
}
.button:hover:after {
right: -50%;
top: -50%;
transform: rotate(45deg);
}