Created
December 16, 2011 18:40
-
-
Save djekl/1487336 to your computer and use it in GitHub Desktop.
Apple Style 'Buy Now' Button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="outer"> | |
<div class="inner"> | |
<a class="button" title="Buy Now" href="#">Buy Now</a> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"page":"css","view":"split"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment