TutorialKart
index.html
►
Run
Reset
<!DOCTYPE html> <html lang="en" class="light-mode"> <head> <meta charset="utf-8"> <style> :root { --bg-color: white; --text-color: black; } html.dark-mode { --bg-color: black; --text-color: white; } body { background-color: var(--bg-color); color: var(--text-color); } button { margin: 20px; padding: 10px; } </style> <script> function toggleMode() { document.documentElement.classList.toggle('dark-mode'); } </script> </head> <body> <button onclick="toggleMode()">Toggle Light/Dark Mode</button> <p>The background and text colors change based on the mode.</p> </body> </html>