button with shadow
by Alexandru Gatea
HTML
<div class="button">
<a href="#!" class="btn">Hover me!</a>
</div>
CSS
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #f5f5f5;
}
.button {
position: relative;
padding-top: 75px;
width: 165px;
margin: auto;
transition: all 0.5s ease;
}
.button:after {
content: "";
opacity:0.6;
width: 100%;
left: 0;
right: 0;
margin: auto;
height: 8px;
position: absolute;
bottom: -5px;
transition: all 0.5s ease;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0.65+0,0+70 */
background: -moz-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0) 100%);
/* FF3.6-15 */
background: -webkit-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0) 100%);
/* Chrome10-25,Safari5.1-6 */
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0) 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000', GradientType=1);
/* IE6-9 fallback on horizontal gradient */
}
.button:hover:after {
width: 55%;
opacity: 0.4;
}
.btn {
display: block;
margin: auto;
width: 165px;
padding: 0 15px;
line-height: 40px;
background: #e80237;
color: #fff;
text-decoration: none;
text-align: center;
font-family: sans-serif;
font-size: 13px;
position: relative;
transition: all 0.6s ease;
top: 0;
border-radius: 2px;
}
.button:hover .btn {
top: -8px;
}
.button:hover .btn {
opacity: 0.95;
}
.button:hover .btn:after {
left: 120%;
}
.btn:after {
content: "";
display:block;
width: 30px;
height: 60px;
position:absolute;
top: -10px;
left: -100%;
background: rgba(255,255,255,0.1);
transform: rotate(30deg);
transition: all 0.5s ease-in-out;
}
.button a {
overflow:hidden;
display:block;
}