Skip to main content

Power On Off Neumorphism Button Using HTML And CSS Only | Coding With Roannie

 


Power On Off Neumorphism Button Using HTML And CSS Only | Coding With Roannie




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">
    <title>Document</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
        body{
            margin0;
            padding0;
            background-color#ececec;
            displayflex;
            justify-contentcenter;
            align-itemscenter;
        }
        input[type="checkbox"]{
            -webkit-appearancenone;
            width250px;
            height250px;
            border-radius50%;
            box-shadow
            -10px -10px 15px  rgba(2552552550.5),
            10px 10px 15px  rgba(7070700.12); 
            top50%;
            left50%;
            positionabsolute;
            transformtranslate(-50%,-50%);
            border8px solid #ececec;
            outlinenone;
            cursorpointer;
        }
        
        input[type="checkbox"]::after{
            font-family: FontAwesome;
            content'\f011';
            font-size70px;
            positionabsolute;
            top37.5%;
            left39%;
            colorrgb(2212525);
            text-shadow1px 1px 10px  rgb(2212525);
        }
        input[type="checkbox"]:checked{
            
            box-shadow:-10px -10px 15px  rgba(2552552550.5),
                        10px 10px 15px  rgba(7070700.12),
                        inset -10px -10px 15px  rgba(2552552550.5),
                        inset  10px 10px 15px  rgba(7070700.12); 
                                        
             
        }
        input[type="checkbox"]:checked:after{
            colorrgb(3720278);
            text-shadow1px 1px 10px  rgb(3720278);

        }
    </style>
</head>
<body> 
    <div>
    <input class="checkbox" type="checkbox" >
    
</div>
<script>
    let checkbox = document.getElementsByClassName("checkbox");
     if(checkbox){
         checkbox.innerHTML = "<h1> Power On </h1>"
     }
     else{

     }
</script>
</body>
</html>


Subscribe On YouTube

Thanks For Visiting