buttons

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

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

Technologies

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

<head>
  <meta charset="UTF-8">
  <title>buttons</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<button class="button1">Click Me</button>
<button class="button2">Click Me</button>
<button class="button3">Click Me</button>
<button class="button4"><span>Click Me</span><div></div></button>
<button class="button5"><span>Click Me</span><div></div></button>
<button class="button6"><span>Click Me</span><div></div></button>
<button class="button7"><span>Click Me</span><div></div></button>
<br><br>
<button class="button8">Click Me</button>
<br>
<button class="button9"><span>Click Me</span><div></div></button>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/lucademian_/buttons-WwXRzY */
.button1{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  border-bottom: 5px #000 solid;
  border-bottom-radius: 3px;
  position: relative;
  transition: top 0.3s;
}
.button1:hover{
  border-bottom-width: 2px;
  top: 3px;
}
.button2{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  border-bottom: 5px #000 solid;
  border-radius: 22px;
  position: relative;
  transition: top 0.3s;
}
.button2:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button2:focus{outline:none;}

.button3{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  border-bottom: 5px #000 solid;
  position: relative;
  transition: top 0.3s;
}
.button3:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button3:focus{outline:none;}

.button4{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  position: relative;
  transition: top 0.3s;
  width:100px;
  height:50px;
  overflow:hidden;
  transition: all 0.4s;
  transition-delay: 0.05s;
}
.button4 div{
  background:#000;
  height:50px;
  width:100px;
  position: absolute;
  margin-top: 100px;
  margin-left:-10px;
  transition: all 0.4s;
}
.button4 span{
  position: relative;
  z-index:9999;
}
.button4:hover div{
  margin-top: -40px;
}
.button4:hover{
  color:#FFF;
}
.button4:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button4:focus{outline:none;}

.button5{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  position: relative;
  transition: top 0.3s;
  width:100px;
  height:50px;
  overflow:hidden;
  transition: all 0.4s;
  transition-delay: 0.05s;
}
.button5 div{
  background:#000;
  height:50px;
  width:100px;
  position: absolute;
  margin-top: 100px;
  margin-left:150px;
  transition: all 0.4s;
}
.button5 span{
  position: relative;
  z-index:9999;
}
.button5:hover div{
  margin-top: -40px;
  margin-left:-10px;
}
.button5:hover{
  color:#FFF;
}
.button5:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button5:focus{outline:none;}
.button6{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  position: relative;
  transition: top 0.3s;
  width:100px;
  height:50px;
  overflow:hidden;
  transition: all 0.4s;
  transition-delay: 0.05s;
}
.button6 div{
  background:#000;
  height:50px;
  width:100px;
  position: absolute;
  margin-top: 100px;
  margin-left:150px;
  transition: all 0.4s;
}
.button6 span{
  position: relative;
  z-index:9999;
}
.button6:hover div{
  margin-top: -40px;
  margin-left:-10px;
  transform: rotate(720deg);
}
.button6:hover{
  color:#FFF;
}
.button6:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button6:focus{outline:none;}
.button7{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  position: relative;
  transition: top 0.3s;
  width:100px;
  height:50px;
  overflow:hidden;
  transition: all 0.4s;
  transition-delay: 0.05s;
}
.button7 div{
  background:transparent;
  height:50px;
  width:100px;
  position: absolute;
  margin-top: -40px;
  margin-left:-10px;
  transition: all 0.4s;
  
}
.button7 span{
  position: relative;
  z-index:9999;
}
.button7:hover div{
  margin-top: -40px;
  margin-left:-10px;
  background:#000;
}
.button7:hover{
  color:#FFF;
  transform: rotateX(360deg);
}
.button7:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button7:focus{outline:none;}
.button8{
  display: block;
  background: rgba(242, 90, 108, 1);
  color:#FFF;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  height:100px;
  width:100px;
  border-bottom: 5px #000 solid;
  border-radius: 50px;
  position: relative;
  transition: top 0.3s;
}
.button8:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button8:focus{outline:none;}
.button9{
  display: inline-block;
  background: transparent;
  border: 2px #000 solid;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  font-size: 20px;
  font-family: "Open Sans", sans-serif;
  cursor: pointer;
  position: relative;
  transition: top 0.3s;
  width:100px;
  height:50px;
  overflow:hidden;
  transition: all 0.4s;
  transition-delay: 0.05s;
}
.button9 div{
  background:#000;
  height:50px;
  width:100px;
  height: 0px;
  width:0px;
  position: absolute;
  margin-top: -15px;
  margin-left:40px;
  transition: all 0.4s;
}
.button9 span{
  position: relative;
  z-index:9999;
}
.button9:hover div{
  margin-top: -40px;
  margin-left:-10px;
  height:50px;
  width:100px;
}
.button9:hover{
  color:#FFF;
}
.button9:active{
  border-bottom-width: 2px;
  top: 3px;
  outline: none;
}
.button9:focus{outline:none;}

/*Downloaded from https://www.codeseek.co/lucademian_/buttons-WwXRzY */
//Look there's no JS!!!!!

Comments