WEBLEB
Home
Editor
Login
Pro
English
English
Français
Español
Português
Deutsch
Italiano
हिंदी
changing light
941
mambetov1237.b
Open In Editor
Publish Your Code
Recommended
29 August 2024
Clock Ui-Dark/light button
9 July 2025
UI Theme Switcher: Light, Dark, Dim Options
15 December 2025
HTML Light Button with Icon and Text
HTML
Copy
Document
press me
CSS
Copy
body { background-color: white; color: black; transition: background-color 0.3s ease, color 0.3s ease; display: flex; align-items: center; justify-content: center; margin: 250px; } body.dark-mode { background-color: blue; color: white; }<!-- Replace with your HTML Code (Leave empty if not needed) -->
JS
Copy
const toggleButton = document.getElementById("theme-toggle"); toggleButton.addEventListener("click", () => { document.body.classList.toggle("dark-mode"); });/* Replace with your JS Code (Leave empty if not needed) */