3d Button

In this example below you will see how to do a 3d Button with some HTML / CSS and Javascript

Really simple sass 3d box-shadow button with an :active state.

Thumbnail
This awesome code was written by barrada, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright barrada ©

Technologies

  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>3d Button</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <link href='https://fonts.googleapis.com/css?family=Open+Sans:800' rel='stylesheet' type='text/css'> 
<div id="container">
  <a href="#">Click Me</a>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/barrada/3d-button-aAknm */
#container {
  max-width: 175px;
  margin: 4em auto;
}

a {
  font-family: "Open Sans", sans-serif;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  color: #000;
  border: 3px solid;
  padding: 0.25em 0.75em;
  -moz-box-shadow: 1px 1px 0px 0px, 2px 2px 0px 0px, 3px 3px 0px 0px, 4px 4px 0px 0px, 5px 5px 0px 0px;
  -webkit-box-shadow: 1px 1px 0px 0px, 2px 2px 0px 0px, 3px 3px 0px 0px, 4px 4px 0px 0px, 5px 5px 0px 0px;
  box-shadow: 1px 1px 0px 0px, 2px 2px 0px 0px, 3px 3px 0px 0px, 4px 4px 0px 0px, 5px 5px 0px 0px;
  position: relative;
}
a:active {
  -moz-box-shadow: 0px 0px 0px 0px;
  -webkit-box-shadow: 0px 0px 0px 0px;
  box-shadow: 0px 0px 0px 0px;
  top: 5px;
  left: 5px;
}

Comments