CSS BUTTON INFINITY FOR WEBSITE

HTML SOURCE CODE

<!DOCTYPE html>

<html>

<head>

<title>CREATE BUTTON CSS</title>

<link rel="stylesheet" type="text/css" href="infinity.css">

</head>

<body>

<a href="#" style="--clr:linear-gradient(190deg,yellow,red,pink,blue)"><span>BUTTON</span><i></i></a>

<a href="#" style="--clr:#ffaaff"><span>BUTTON</span><i></i></a>

<a href="#" style="--clr:#1e9bff"><span>BUTTON</span><i></i></a>


</body>

</html>

CSS SOURCE CODE

*

{

margin: 0;

padding: 0;

box-sizing: border-box;

font-family: sans-serif;

}

body

{

display: flex;

justify-content: center;

align-items: center;

min-height: 100vh;

background: #27282c;

flex-direction: column;

gap:50px;

}

a

{

position: relative;

background: #fff;

color: #fff;

text-decoration: none;

text-transform: uppercase;

font-size: 1.5em;

letter-spacing: 0.1em;

font-weight: 400;

padding: 10px 30px;

transition: 0.5em;


}

a:hover{

background: var(--clr);

color: var(--clr);

letter-spacing: 0.25em;

box-shadow: 0 0 35px var(--clr);


}

a:before{

content: '';

position: absolute;

inset:2px;

background: #27282c;

}

a span{

position: relative;

z-index: 1;

}

a i{

position: absolute;

inset:0;

display: block;

}

a i::before{

content: '';

position: absolute;

top: 0;

left: 80%;

width: 10px;

height: 4px;

background: #27282c;

transform: translateX(-50%) skewX(325deg);

transition: 0.5s;

}

a:hover i::before{

width: 20px;

left: 20%;

}


a i::after{

content: '';

position: absolute;

bottom: 0;

left: 20%;

width: 10px;

height: 4px;

background: #27282c;

transform: translateX(-50%) skewX(325deg);

transition: 0.5s;

}

a:hover i::after{

width: 20px;

left: 80%;

}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.