Skip to content

Instantly share code, notes, and snippets.

@phirefly
Created June 20, 2013 03:16
Show Gist options
  • Save phirefly/5820057 to your computer and use it in GitHub Desktop.
Save phirefly/5820057 to your computer and use it in GitHub Desktop.
Flat css button style
.button {
display: inline-block;
padding: 4px 10px;
margin-bottom: 0;
font-size: 12px;
line-height: 18px;
color: #666666;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -ms-linear-gradient(bottom, #dddddd 0%, #f9f9f9 100%);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f9f9f9), to(#dddddd));
background-image: -webkit-linear-gradient(bottom, #dddddd 0%, #f9f9f9 100%);
background-image: -o-linear-gradient(bottom, #dddddd 0%, #f9f9f9 100%);
background-image: linear-gradient(bottom, #dddddd 0%, #f9f9f9 100%);
background-image: -moz-linear-gradient(bottom, #dddddd 0%, #f9f9f9 100%);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
text-decoration: none;
}
.button:hover {
background-color: #dddddd;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-ms-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
text-decoration: none;
}
.button:active {
background-color: #dddddd;
outline: 0;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
background-image: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment