Neon Light Button Effect

 

neon hover buttons gif

Learn how to create Neon Light Button Effect On Hover using only using only HTML and CSS.

Watch the tutorial video here-



The VS Code extensions used in this video are Live Server, Bracket Pair Colorizer, and Prettier.


HTML Source 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="style.css">
    <title>Document</title>
</head>
<body>
    <div class="container">
        <button class="btn" id="btn1">Hover Me</button>
        <button class="btn" id="btn2">Hover Me</button>
        <button class="btn" id="btn3">Hover Me</button>
        <button class="btn" id="btn4">Hover Me</button>
    </div>
</body>
</html>

Download HTML source file

CSS Source Code-

body{
    margin: 0;
    padding: 0;
    background-color: #000000;
}

.container{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid;
    padding: 40px;
    border-radius: 40px;
    text-align: center;
    border-color: #00ff00 #ffff00 #ff0000 #00ffff;
}

.btn{
    width: 240px;
    border-radius: 100px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 26px;
    background-color: #000000;
    padding: 22px;
    margin: 22px;
    cursor: pointer;
    transition: 0.5s;
    font-weight: 400;
    text-transform: uppercase;
}

.btn:hover{
    transform: scale(1.1);
}

#btn1{
    color: #ff0000;
    border: 4px solid #ff0000;
}
#btn2{
    color: #ffff00;
    border: 4px solid #ffff00;
}
#btn3{
    color: #00ff00;
    border: 4px solid #00ff00;
}
#btn4{
    color: #00ffff;
    border: 4px solid #00ffff;
}

#btn1:hover{
    box-shadow: 0 5px 40px 0 #ff0000 inset, 0 5px 40px 0 #ff0000,
                0 5px 40px 0 #ff0000 inset, 0 5px 40px 0 #ff0000;
}
#btn2:hover{
    box-shadow: 0 5px 40px 0 #ffff00 inset, 0 5px 40px 0 #ffff00,
                0 5px 40px 0 #ffff00 inset, 0 5px 40px 0 #ffff00;
}
#btn3:hover{
    box-shadow: 0 5px 40px 0 #00ff00 inset, 0 5px 40px 0 #00ff00,
                0 5px 40px 0 #00ff00 inset, 0 5px 40px 0 #00ff00;
}
#btn4:hover{
    box-shadow: 0 5px 40px 0 #00ffff inset, 0 5px 40px 0 #00ffff,
                0 5px 40px 0 #00ffff inset, 0 5px 40px 0 #00ffff;
}

Download CSS source file


Post a Comment

0 Comments