DEV Community

Cover image for How to make "2D To 3D Button".
Harshit Khaladkar🇮🇳
Harshit Khaladkar🇮🇳

Posted on

How to make "2D To 3D Button".

Hi Guys,In this Blog I will show you how to make 2D To 3D Button
Tutorial 👇
Tutorial

Source:-

HTML:-

<body>
<a href="#">tap on me</a>
</body>
Enter fullscreen mode Exit fullscreen mode

CSS :-

body
{
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #2196f3;
}
a
{
  position: relative;
  padding: 20px 20px 20px 30px;
  color: #fff;
  font-size: 20px;
  font-family: sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 10px;
  transition: 0.5s;
}
a:hover
{
  background: #2196f3;
  transition-delay: 2s;
  box-shadow: -30px 30px 50px rgba(0,0,0,.4);
  transform: rotate(-30deg) skew(35deg);
}
a:before,
a:after
{
  content: '';
  position: absolute;
  width: 2px;
  height: 100%;
  background: #fff;
  pointer-events: none;
  transform-style: linear;
  transition-property: width,opacity,transform,box-shadow;
  transition-duration: 0.5s;
}
a:before
{
  top: 0;
  left: 0;
}
a:after
{
  top: 0;
  right: 0;
}
a:hover:before
{
   width:100%;
   opacity: 0.1;
   transform: translate(5px,-5px);
   box-shadow: +2px 2px 2px rgba(0,0,0,.1);
   transition-delay: 0s,0.5s,1s,1.5s;
}
a:hover:after
{
   width:100%;
   opacity: 0.1;
   transform: translate(10px,-10px);
   box-shadow: +2px 2px 2px rgba(0,0,0,.1);
   transition-delay: 0s,0.5s,1s,1.5s;
}
Enter fullscreen mode Exit fullscreen mode

<br>
A pie chart showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"

A pie chart showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"
Thanks for Reading My Post . Please like and Share.

Top comments (0)