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{
    margin0;
    padding0;
    background-color#000000;
}

.container{
    positionabsolute;
    left50%;
    top50%;
    transformtranslate(-50%-50%);
    border2px solid;
    padding40px;
    border-radius40px;
    text-aligncenter;
    border-color#00ff00 #ffff00 #ff0000 #00ffff;
}

.btn{
    width240px;
    border-radius100px;
    font-family'Segoe UI'Tahoma, Geneva, Verdanasans-serif;
    font-size26px;
    background-color#000000;
    padding22px;
    margin22px;
    cursorpointer;
    transition0.5s;
    font-weight400;
    text-transformuppercase;
}

.btn:hover{
    transformscale(1.1);
}

#btn1{
    color#ff0000;
    border4px solid #ff0000;
}
#btn2{
    color#ffff00;
    border4px solid #ffff00;
}
#btn3{
    color#00ff00;
    border4px solid #00ff00;
}
#btn4{
    color#00ffff;
    border4px solid #00ffff;
}

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

Download CSS source file


Post a Comment

0 Comments