acegoal07 Posted April 8, 2020 Share Posted April 8, 2020 i need help i cant get my dark mode to change the colour of my nav bar if anyone can help me with this it would be great Link to comment Share on other sites More sharing options...
shaili_shah Posted April 10, 2020 Share Posted April 10, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now