How to Implement Dark mode with only HTML and CSS ? (NO JavaScript).

 Dark mode Implementation using HTML and CSS.



                                                                             This program is about creating Dark mode

 Effect on any Website. As you toggle given button in program you will find Dark mode Effect

 on Web page and also content of button will toggle there.


PROGRAM SOURCE CODE : -



1) HTML coding :-



<!DOCTYPE html>
<html>
<head>
    <title>Night Mode Designing</title>
    <link rel="stylesheet" type="text/css" href="nightmode.css">
</head>
<body>
    <input type="checkbox" id="i">
    <label for="i"><span></span></label>
    <div class="body">
        <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>
    </div>
</body>
</html>



2) CSS coding :-




*{
    margin0px;
    padding0px;
    box-sizingborder-box;
}
.body{
    height100vh;
    width100vw;
}
html{
    font-size62.5%;
}
p{
    font-size:2rem;
    line-height30px;
    font-familyGeorgia;
    letter-spacing:1.5px;
    word-wrapbreak-word;
    padding20px 30px;
}
p::first-letter{
    font-size40px;
}
input{
    displaynone;
}
label{
    cursorpointer;
    border:2px solid #000;
    padding10px 20px;
    font-familyArial;
    letter-spacing1px;
    background-colorblue;
    positionabsolute;
    bottom2%;
    left:3%;
    color#fff;
    font-size20px;
}
label span::before{
    content'Dark Mode ON';
}
#i:checked ~ .body{
    background-color#000;
    color#fff;
}
#i:checked ~ label{
    border-color#fff;
}
#i:checked ~ label span::before{
    content'Dark Mode OFF';
}





OUTPUT :- 







( NOTE : - While executing program you have to replace links of images , audio's  or video's in this program by your links. So take care of it ! )