Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

Suggested Dark Mode <Code>

  • So I think Opera GX needs better dark mode. Here's the code in HTML, CSS, JS!

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    body {
      padding: 25px;
      background-color: #f2f2f2;
      color: #616161;
      font-size: 25px;
    }
    
    .dark-mode {
      background-color: #616161;
      color: #f2f2f2;
    }
    </style>
    </head>
    <body>
    
    <p>Dark Mode</p>
    <button onclick="myFunction()">Toggle dark mode</button>
    
    <script>
    function myFunction() {
       var element = document.body;
       element.classList.toggle("dark-mode");
    }
    </script>
    
    </body>
    </html>
    

    Hope u like it! Test the code at something like repl.it or w3schools.com

Log in to reply