djekl
12/16/2011 - 6:40 PM

Apple Style 'Buy Now' Button

Apple Style 'Buy Now' Button

{"page":"css","view":"split"}
<div class="outer">
  <div class="inner">
    <a class="button" title="Buy Now" href="#">Buy Now</a>
  </div>
</div>
/**
 * Apple Style 'Buy Now' Button
 */

html {
    background: #f06;
    background: linear-gradient(45deg, #f06, yellow);
    min-height:100%;
}

.button {
    padding: .35em 1em;
    font-family: Lucida Grande, Helvetica, Arial, sans-serif;
    text-decoration: none;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    font-size: .75em;
    line-height: 1.5;
    text-shadow: 0 -1px 1px rgba(0,0,0,.3);
    background-image: -webkit-linear-gradient(#52A8E8, #377AD0);
    background-image: -moz-linear-gradient(0% 100% 90deg,#377AD0, #52A8E8);
    background-color: #52A8E8;
    border-radius: 23px;
    border: 1px solid #20559A;
    box-shadow: 0 1px 2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.3);
}

.button:hover, .button:focus {
    background-image: -webkit-linear-gradient(#54A1D8, #1967CA);
    background-image: -moz-linear-gradient(0% 100% 90deg,#1967CA, #54A1D8);
    background-color: #52A8E8;
    box-shadow: 0 1px 0 rgba(255,255,255,.6), inset 0 1px 0 rgba(255,255,255,.3);
    color: #fff;
}

.button:active {
    background-color: #2D7CD1;
    box-shadow: 0 1px 1px rgba(255,255,255,.5), inset 0 2px 5px rgba(0,0,100,.5);
    color: #fff;
}



/* Dynamically center */
html,body {
    height: 100%;
    margin: 0;
    padding: 0;
    outline: 0;
}

.outer {
    display: table;
    height: 100%;
    overflow: hidden;
    margin: 0 auto;
}

.inner {
    display: table-cell;
    vertical-align: middle;
}