Jump to content
Sign in to follow this  
acegoal07

Darkmode

Recommended Posts

I am unclear about your question.

But the more I understood, the more I would explain. Here is my code for darkmode option.

Example :

<style>
        body {
            padding: 25px;
            background-color: white;
            color: black;
            font-size: 25px;
        }

        .dark-mode {
            background-color: black;
            color: white;
        }
    </style>

<body>

<h2>Dark mode</h2>

<p>tap the button.</p>

<button onclick="myFunction()">dark mode</button>

<script>

function myFunction() {
            var element = document.body;
            element.classList.toggle("dark-mode");
        }

</script>

</body>

I hope you'll understand.

If you have any doubt then you can freely ask.

Thank You.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...