<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button Hover Effect</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<button class="btn">Hover</button>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.btn{
width: 120px;
height: 40px;
font-size: 1.1em;
background: none;
border: none;
color: white;
position: relative;
cursor: pointer;
}
.btn::before,.btn::after{
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #00000000;
backdrop-filter: blur(20px);
border-radius: 10px;
z-index: -2;
}
.btn::after{
width: 110%;
height: 90%;
top: 25%;
left: -5%;
background: #2C2891;
z-index: -3;
transform: scaleX(0.5);
transition: all .6s;
}
.btn:hover::after{
transform: scaleX(1.01) translateY(-15px);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.