Step 1:Create css file like style.css.
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;1,100;1,300&family=Slabo+27px&display=swap");
*::after,
*::before {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0px;
padding: 0px;
}
ul,
li {
margin: 0px;
padding: 0px;
list-style: none;
font-family: "Roboto", sans-serif;
font-style: normal;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0px;
padding: 0px;
font-weight: 500;
font-family: "Roboto", sans-serif;
font-style: normal;
}
p {
margin: 0px;
padding: 0px;
font-family: "Roboto", sans-serif;
font-style: normal;
}
table,
thead,
tbody,
tr,
th,
td {
font-family: "Roboto", sans-serif;
font-style: normal;
}
hr {
margin: 0px;
padding: 0px;
}
input,
button,
select,
optgroup,
textarea {
font-family: "Roboto", sans-serif;
font-style: normal;
}
a,
strong,
label,
span,
img,
b {
font-family: "Roboto", sans-serif;
transition: all 0.3s ease 0s;
font-style: normal;
}
a,
a:hover,
a:focus,
a:active,
a:link {
outline: none;
text-decoration: none;
color: #000;
}
a.bs-btn:focus {
outline: 0;
box-shadow: none;
}
button.bs-btn:focus {
outline: 0;
box-shadow: none;
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<title>animaion button three</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<style type="text/css">
button.bs-btn:focus {
outline: 0;
box-shadow: none;
}
button.bs-btn {
position: relative;
display: inline-block;
min-width: 170px;
max-width: 170px;
padding: 14px 0px;
text-transform: uppercase;
font-size: 14px;
text-align: center;
border: 1px solid #000;
border-radius: 40px;
overflow: hidden;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
background: no-repeat;
cursor: pointer;
color: #000;
z-index: 2;
margin: 5px 0px;
}
button.bs-btn:hover {
border: 1px solid #071982;
color: #80ffd3 !important;
}
button.bs-btn::before {
content: "";
width: 0%;
height: 100%;
display: block;
background: #071982;
position: absolute;
-ms-transform: skewX(-20deg);
-webkit-transform: skewX(-20deg);
transform: skewX(-20deg);
left: -10%;
opacity: 1;
top: 0;
z-index: -12;
-moz-transition: all 0.7s cubic-bezier(0.77, 0, 0.175, 1);
-o-transition: all 0.7s cubic-bezier(0.77, 0, 0.175, 1);
-webkit-transition: all 0.7s cubic-bezier(0.77, 0, 0.175, 1);
transition: all 0.7s cubic-bezier(0.77, 0, 0.175, 1);
box-shadow: 2px 0px 14px rgba(0, 0, 0, 0.6);
}
button.bs-btn::after {
content: "";
width: 0%;
height: 100%;
display: block;
background: #80ffd3;
position: absolute;
-ms-transform: skewX(-20deg);
-webkit-transform: skewX(-20deg);
transform: skewX(-20deg);
left: -10%;
opacity: 0;
top: 0;
z-index: -15;
-webkit-transition: all 0.94s cubic-bezier(0.2, 0.95, 0.57, 0.99);
-moz-transition: all 0.4s cubic-bezier(0.2, 0.95, 0.57, 0.99);
-o-transition: all 0.4s cubic-bezier(0.2, 0.95, 0.57, 0.99);
transition: all 0.4s cubic-bezier(0.2, 0.95, 0.57, 0.99);
box-shadow: 2px 0px 14px rgba(0, 0, 0, 0.6);
}
button.bs-btn:hover::before,
button.bs-btn:hover::before {
opacity: 1;
width: 116%;
}
button.bs-btn:hover::after,
button.bs-btn:hover::after {
opacity: 1;
width: 120%;
}
@media (max-width: 768px) {
button.bs-btn {
min-width: 150px;
max-width: 150px;
}
}
</style>
</head>
<body>
<!-- container -->
<div class="container">
<div class="button">
<h2>CSS buttons hover effects</h2>
<button class="bs-btn"><span>button hover</span>
</button>
<button class="bs-btn"><span>button hover</span>
</button>
<button class="bs-btn"><span>button hover</span>
</button>
</div>
</div>
<!-- container end-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.js"></script>
</body>
</html>