Beautiful hover effect 1
HTML CODE
<!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">
<link rel="stylesheet" href="hover1.css">
<title>Document</title>
</head>
<body>
<a class="one" href="#">
<span class="no"></span>
<span class="no"></span>
<span class="no"></span>
<span class="no"></span>
Hover
</a>
<a class="two" href="#">
<span class="op"></span>
<span class="op"></span>
<span class="op"></span>
<span class="op"></span>
Omg Mdn
</a>
</body>
</html>
CSS CODE
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #031321;
font-family: Product sans;
}
.one{
position: relative;
display: inline-block;
padding: 15px 30px;
color: #ff4a4a;
text-transform: uppercase;
letter-spacing: 4px;
text-decoration: none;
font-size: 24px;
overflow: hidden;
transition: 0.2s;
}
.one:hover{
color: #870317;
background: #ff4a4a;
box-shadow: 0 0 10px #ff4a4a, 0 0 40px #ff4a4a, 0 0 80px #ff4a4a;
transition-delay: 1s;
}
.one .no{
position: absolute;
display: block;
}
.one .no:nth-child(1){
top: 0;
left: -200px;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent,#ff4a4a);
}
.one:hover .no:nth-child(1){
left: 100%;
transition: 1s;
}
.one .no:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #ff4a4a);
}
.one:hover .no:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: 0.5s;
}
.one .no:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #ff4a4a);
}
.one:hover .no:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: 0.25s;
}
.one .no:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(160deg, transparent, #ff4a4a);
}
.one:hover .no:nth-child(4){
bottom: 100%;
transition: 0.7s;
transition-delay: 0.7s;
}
/* --------------------------- */
.two{
position: relative;
display: inline-block;
padding: 25px 40px;
color: #ffea00;
text-transform: uppercase;
letter-spacing: 4px;
text-decoration: none;
font-size: 24px;
overflow: hidden;
transition: 0.2s;
}
.two:hover{
color: #3d3801;
background: #ffea00;
box-shadow: 0 0 10px #ffea00, 0 0 40px #ffea00, 0 0 80px #ffea00;
transition-delay: 1s;
}
.two .op{
position: absolute;
display: block;
}
.two .op:nth-child(1){
top: 0;
left: -250px;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent,#ffef40);
}
.two:hover .op:nth-child(1){
left: 100%;
transition: 1s;
}
.two .op:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #ffef40);
}
.two:hover .op:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: 0.5s;
}
.two .op:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #ffef40);
}
.two:hover .op:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: 0.25s;
}
.two .op:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(160deg, transparent, #ffef40);
}
.two:hover .op:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: 0.75s;
}
Comments
Post a Comment