<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Animated Buttons</title>
</head>
<body>
  <div class="container">
    <button class="btn btn1">Hover Me</button>
    <button class="btn btn2">Hover Me</button>
    <button class="btn btn3">Hover Me</button>
    <button class="btn btn4">Hover Me</button>
  </div>
</body>
</html>
body
{
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ecf0f1;
}

.container
{
  perspective: 320px;
}

.btn
{
  display: block;
  margin: 40px 0;
  width: 240px;
  height: 80px;
  border: none;
  background-color: #00a8ff;
  color: #fff;
  font-size: 18px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: .3s linear;
}

.btn1:hover {
  transform: rotateX(15deg);
  box-shadow: 0 15px 15px #00a8ff;
}

.btn2:hover {
  transform: rotateX(-15deg);
  box-shadow: 0 -15px 15px #00a8ff;
}

.btn3:hover {
  transform: rotateY(15deg);
  box-shadow: -15px 0 15px #00a8ff;
}

.btn4:hover {
  transform: rotateY(-15deg);
  box-shadow: 15px 0 15px #00a8ff;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.