Skip to content
Advertisements

CSS 3D Button


HTML CODE:

HTML  CSS Result
EDIT ON
 <!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="1.page.css">
</head>
<body>

    <a href="#">CODE BLOGGER</a>

</body>
</html>

CSS CODE:

body{
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #990000;
}
a{
  position: absolute;
  padding: 20px 20px 20px 30px;
  color: #fff;
  font-size: 20px;
  font-family: sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 5px;
  transition: .5s;
}
a:hover{
  background: #990000;
  transition-delay: 2s;
  box-shadow: -30px 30px 50px rgba(0,0,0,.4);
  transform: rotate(-20deg) skew(15deg);
}
a:before,
a:after{
  content: "";
  position: absolute;
  height: 100%;
  width: 2px;
  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
}
p{
  position: absolute;
  left: 950px;
  top: 44%;
  padding: 20px 20px 20px 30px;
  color: #fff;
  font-size: 20px;
  font-family: sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 5px;
  transition: .5s;
}
p:hover{
  background: #990000;
  transition-delay: 2s;
  box-shadow: -30px 30px 50px rgba(0,0,0,.4);
  transform: rotate(20deg) skew(-15deg);
}
p:before,
p:after{
  content: "";
  position: absolute;
  height: 100%;
  width: 2px;
  background: #fff;
  pointer-events: none;
  transform-style: linear;
  transition-property: width,opacity,transform,box-shadow;
  transition-duration: 0.5s

}
p:before{
  top: 0;
  left:0;
}
p:after{
  top: 0;
  right:0;
}
p: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
}
p: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
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: