Skip to content

Instantly share code, notes, and snippets.

@sashtown
Created April 29, 2013 10:20
Show Gist options
  • Save sashtown/5480806 to your computer and use it in GitHub Desktop.
Save sashtown/5480806 to your computer and use it in GitHub Desktop.
A nice gradient button with smooth transition.
.button {
display: inline-block;
padding: 10px 20px;
font-size: 20px;
font-weight: bold;
color: #6c3021;
border: 1px solid #8a4231;
background-color: #9F513E;
background: -webkit-linear-gradient(top, #bd6853, #9F513E);
background: -moz-linear-gradient(top, #bd6853, #9F513E);
background: -ms-linear-gradient(top, #bd6853, #9F513E);
background: -o-linear-gradient(top, #bd6853, #9F513E);
background: linear-gradient(to bottom, #bd6853, #9F513E);
box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
text-shadow: 0 1px 0 rgba(220, 128, 105, 0.7), 0 -1px rgba(138, 66, 49, 0.5);
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
transition: all 1s ease;
}
.button:hover {
color: #bbb;
border: 1px solid #2a3433;
background-color: #394241;
background: -webkit-linear-gradient(top, #535d5c, #394241);
background: -moz-linear-gradient(top, #535d5c, #394241);
background: -ms-linear-gradient(top, #535d5c, #394241);
background: -o-linear-gradient(top, #535d5c, #394241);
background: linear-gradient(to bottom, #535d5c, #394241);
box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}
<a class="button" href="#">Gradient Button</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment