css dark mode
@media (prefers-color-scheme: dark) {
body {
background-color: black;
color: white;
}
}
css dark mode
@media (prefers-color-scheme: dark) {
body {
background-color: black;
color: white;
}
}
how to make a dark mode html
<!DOCTYPE html>
<html>
<head><title>How to Dark Mode in HTML5</title></head>
<body>
<button onclick="darkMode()">Click me</button>
</body>
<script>
function darkMode() {
if (document.body.style.backgroundColor == "black") {
document.body.style.backgroundColor = "white";
} else {
document.body.style.backgroundColor = "black";
}
console.log(document.body.style.backgroundColor); // ctrl + j and you can see which mode you're in
}
</script>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us