Button hover using css

 



<!doctype html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title></title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    body {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background: #111;
    }
    .btn {
      display: inline-block;
      color: rgb(200,200,200);
      font-size: 19px;
      font-weight: 500;
      letter-spacing: 2px;
      font-variant: small-caps;
      font-family: arial;
      border: 1px solid crimson;
      padding: 15px 30px;
      text-align: center;
      text-decoration: none;
      position: relative;
      z-index: 2;
      overflow: hidden;
      margin-bottom: 55px;
      transition: color 0.4s linear;
    }
    .btn:hover{
      color: rgba(12, 202, 15, 1);
    }
    .btn1::after {
      content: '';
      display: block;
      width: 0%;
      height: 100%;
      background: crimson;
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      transition: width 0.4s linear;
    }
    .btn1:hover::after{
      width: 100%;
    }
   
   
    .btn2::after {
      content: '';
      display: block;
      width: 100%;
      height: 0%;
      background: crimson;
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      transition: height 0.4s linear;
    }
    .btn2:hover::after {
      height: 100%;
    }
   
    .btn3::after {
      content: '';
      display: block;
      width: 0%;
      height: 0%;
      background: crimson;
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      transition: all 0.4s linear;
    }
    .btn3:hover::after {
      height: 100%;
      width: 100%;
    }
   
   
    .btn4::after {
      content: '';
      display: block;
      width: 0%;
      height: 0%;
      background: crimson;
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: -1;
      transition: all 0.4s linear;
    }
    .btn4:hover::after {
      height: 100%;
      width: 100%;
    }
   
   
    .btn5::after {
      content: '';
      display: block;
      width: 100%;
      height: 0%;
      background: crimson;
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: -1;
      transition: height 0.4s linear;
    }
    .btn5:hover::after {
      height: 100%;
    }
    .btn6::after {
      content: '';
      display: block;
      width: 0%;
      height: 100%;
      background: crimson;
      position: absolute;
      bottom: 0;
      right: 0;
      z-index: -1;
      transition: width 0.4s linear;
    }
    .btn6:hover::after {
      width: 100%;
    }
  </style>
</head>
<body>

<a href="#" class="btn btn1">Explore more</a> 

<a href="#" class="btn btn2">Explore more</a> 

<a href="#" class="btn btn3">Explore more</a> 

<a href="#" class="btn btn4">Explore more</a> 

<a href="#" class="btn btn5">Explore more</a> 

<a href="https://youtube.com/@codexpranav" class="btn btn6">My Youtube</a>
</body>
</html>