Skip to content

Instantly share code, notes, and snippets.

@adrianrodriguez
Created July 19, 2011 14:12
Show Gist options
  • Save adrianrodriguez/1092483 to your computer and use it in GitHub Desktop.
Save adrianrodriguez/1092483 to your computer and use it in GitHub Desktop.
Pure CSS Button
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<style type="text/css" media="screen">
.wrapper {
width: 100px;
margin: 200px auto;
}
.button {
background: rgba(0,0,0,1);
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, from(#484545), to(#2c2c2b));
border-radius: 4px 4px 6px 6px;
border: 1px solid #282727;
box-shadow: inset 0px 0px 5px rgba(0,0,0,0.0);
border-bottom: 1px solid #383837;
display: block;
text-align: center;
width: 100px;
padding: 10px 20px 15px;
color: #fff;
text-shadow: 0px -1px 0px rgba(0,0,0,0.55);
position: absolute;
top: -2px;
left: 0px;
z-index: 2;
font-weight: bold;
font-family: Helvetica, Arial, sans-serif;
}
.button_underneath {
background: #282727;
border-radius: 5px;
position: relative;
width: 102px;
padding: 10px 20px 20px;
margin-top: 50px;
z-index: 1;
display: block;
box-shadow: 0px 1px 5px rgba(0,0,0,0.75)
}
.button:hover {
cursor: pointer
}
.button:active {
top: 0px
}
</style>
</head>
<body id="" onload="">
<div class="wrapper">
<div class="button_underneath">
press me
<div class="button">
press me
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment