“mode gelap html css javascript” Kode Jawaban

Mode Gelap CSS

@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
    color: white;
  }
}
Cookie_Wookie_7

mode gelap html css javascript

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
  padding: 25px;
  background-color: white;
  color: black;
  font-size: 25px;
}

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

<h2>Toggle Dark/Light Mode</h2>
<p>Click the button to toggle between dark and light mode for this page.</p>

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

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

</body>
</html>

Better Bat

Mode Gelap CSS

dark {
  background-color: black;
  color: white;
}
Insert_Name_Here

Jawaban yang mirip dengan “mode gelap html css javascript”

Pertanyaan yang mirip dengan “mode gelap html css javascript”

Lebih banyak jawaban terkait untuk “mode gelap html css javascript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya