<head>
    <meta charset="UTF-8" />
    <title>Pressed effect on button</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="style.css" />
    <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
  </head>
  <body>
    <div class="animated_btn">
      <button class="btn">Click me</button>
    </div>
  </body>
* {
  padding: 0;
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
}
body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f1f2f3;
}
button.btn {
    border: 0;
    padding: 12px 40px;
    font-size: 18px;
    background: #4b00ff;
    color: #fff;
    border-radius: 5px;
    box-shadow: 5px 5px 25px 1px rgba(0,0,0,0.25);
    cursor: pointer;
    outline: 0;
    transition: 0.3s linear;
}
button.btn:active {
    transform: scale(0.85);
    box-shadow: 3px 2px 25px 1px rgba(0,0,0,0.25);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.