CSS3 Gradient Transition

by Umar

HTML

<body>
<a href="#"><span>I'm a button.</span></a>
</body>

CSS

body
{
    font-family:Helvetica, Arial, sans-serif;
    width:300px;
    margin:150px auto;
}
a
{
    background:#59888C;
    width:300px;
    text-align:center;
    padding:10px;
    -webkit-box-shadow:0 3px 3px rgba(0,0,0,.3);
    box-shadow:0 3px 3px rgba(0,0,0,.3);
    position:relative;
    z-index:1;
    -webkit-transition:background .2s ease-in-out;
    -moz-transition:background .2s ease-in-out;
    text-decoration:none;
    color:#fff;
    font-weight:bold;
}
a span
{
    position:relative;
    z-index:3;
}
a, a:after
{
    border-radius:16px;
    display:block;
}
a:after
{
    position:absolute;
    z-index:2;
    background-image:-webkit-gradient(linear, 0 0, 0 100%, from(transparent), to(rgba(0,0,0,.3)));
    background-image:-moz-linear-gradient(transparent, rgba(0,0,0,.3));
    left:0;
    top:0;
    content:'';
    width:100%;
    height:100%;
}
a:hover
{
    background:#223F59;
}