Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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>
Comment

css dark mode

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

easy ways to implement dark mode html css

<meta name="color-scheme" content="dark light">
Comment

easy ways to implement dark mode html css

<meta name="color-scheme" content="dark light">
Comment

css dark mode

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

PREVIOUS NEXT
Code Example
Css :: css grid properties 
Css :: css delay between animation iterations 
Css :: css filter img color etc 
Css :: add arrow in select css 
Css :: input type file placeholder 
Css :: vertical and horizontal align center div 
Css :: css custom bullet list 
Css :: multiple box shadows css 
Css :: CSS technique for a horizontal line with icons in the middle 
Css :: terminal check time 
Css :: setting z index on before after pseudo classes 
Css :: auto suggestion in jupyter notebook 
Css :: object fit css 
Css :: background image repeat css 
Css :: how to disable css-select select box 
Css :: css change image width 
Css :: make table resopnsive for mobile 
Css :: flex grow 
Css :: css background image not working 
Css :: adding a background color in css 
Css :: refresh css on page 
Css :: button click css style 
Css :: mb in bootstrap 
Css :: flex flow 
Css :: ease in out css 
Css :: div set text colo0r 
Css :: style button for safari 
Css :: how to style ul circles black in css 
Css :: centrizing a table with css 
Css :: css when i add a border radius to input problem 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =