CSS3 Buttons w/ motion

by Dylan Schadeck

HTML

<html>
<head>
<link href="style.css" rel="stylesheet" type='text/css'>
</head>
<body>
<div class="button">
<a href="#">About</a>
<a class="green" href="#">Contact</a>
<a class="yellow" href="#">Blog</a>
</div>
</body>
</html>

CSS

body {
margin: 0 auto;
width: 900px;
text-align: center;
padding: 10% 0 0 10%;
}

.button {
display:block;
font-weight:normal;
clear:both;
}
a {
display:block;
float: left;
text-align: center;
margin: 0 auto;

}
.button a {
-webkit-transform: translate3d( 0, 0px, 0);

-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;

text-decoration:none;
font-family:'Helvetica Neue', Helvetica, Arial;
font-weight:500;
font-size:0.8em;
color: #7597a9;
text-shadow: 0px 1px 0px rgba(255,255,255,1);

background: rgb(249,252,252); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(249,252,252,1) 0%, rgba(211,227,232,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(249,252,252,1)), color-stop(100%,rgba(211,227,232,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(249,252,252,1) 0%,rgba(211,227,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(249,252,252,1) 0%,rgba(211,227,232,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(249,252,252,1) 0%,rgba(211,227,232,1) 100%); /* IE10+ */
background: linear-gradient(to bottom,  rgba(249,252,252,1) 0%,rgba(211,227,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9fcfc', endColorstr='#d3e3e8',GradientType=0 ); /* IE6-9 */
-webkit-font-smoothing: antialiased;

padding:5px 8px;
border: 1px solid rgba(100,136,156,0.40);
border-botom: 1px solid rgba(100,136,156,0.55);
border-top: 1px solid rgba(255,255,255,0.2);
box-shadow: 0px 1px 1px rgba(0,0,0,0.075), inset 0px 1px 0px rgba(255,255,255,1), inset 0px -1px 0px rgba(255,255,255,0.75);

-webkit-border-radius: 4px;
border-radius: 4px;

margin-right: 10px;
}

.button a:hover {
color: #64889c;
opacity:0.7;
-webkit-transform: translate3d( 0, -3px, 0);
}

.button a:active...