i want to make like this style in hover with animation
CodePudding user response:
I got your query, I think below mentioned code is the solution for your query.
@import url('https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #0e1538;
}
.container{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.container a{
position: relative;
width: 160px;
height: 60px;
display: inline-block;
background-color: #fff;
margin: 20px;
}
.container a:before, .container a:after{
content: '';
position: absolute;
inset: 0;
/* background: #f00; */
background: linear-gradient(45deg,#00ccff,#0e1538,#0e1538,#d400d4);
transition: 0.2s;
}
.container a:hover:before{
inset: -3px;
}
.container a:hover:after{
inset: -3px;
filter: blur(10px);
}
.container a span{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: inline-block;
background: #0e1538;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2em;
text-transform: uppercase;
letter-spacing: 2px;
color: #fff;
}
<!DOCTYPE html>
<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>Glowing Gradient Border Effect</title>
</head>
<body>
<div >
<a href="#">
<span>Button</span>
</a>
</div>
</body>
</html>