skip to Main Content

Using Google Chrome (or Microsoft Edge) on Windows 11, I cannot visualize a very simple HTML page with a white background.

If you try to visualize the following page with Edge, the background will always be black:

<html>
    <head>
        <title>Test</title>
        <style type="text/css">
              body { background-color: white; }
        </style>
    </head>
    <body>
        TEST
    </body>
</html>

If I set background-color: red, the background will be red, as expected.

Firefox has the page displayed correctly in all cases.

How to display a page with a white background?

2

Answers


  1. Chosen as BEST ANSWER

    I found the reason. On all my computers I use the force dark setting for both Chrome and Edge. This setting causes all web pages not having explicit support for dark mode to render as if they were using dark mode:

    chrome://flags/#enable-force-dark
    

    If I restore the default value for this setting (Default instead of Enabled), the background can indeed be white.


  2. I think that because you are using a corrupted chrome or edge ,Try to reinstall them, or use the sfc/scannow ,that should fix all corrupted file, from them the web browsers’ too like what I think. Try that and see.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search