0

(If I've used the wrong tag for this please move to appropriate section.)

I've seen some articles online about using CSS or plain HTML for controlling light/dark mode appearance based on the user's preference, i.e., what they choose on their browser. I've made webpages where the image showed up once the mode was changed but it's either in a div, section, etc. But when I made a background image in the html area then once the it's changed to dark mode the image disappears replaced by black. I hope I've explained that well. Anyway, suggestions to solve this will be appreciated. By the way, I do not want to darken the background image since it's already of a softer light which doesn't jar the dark mode.

Thank You

D. V.
  • 1
  • Does this answer your question? [How to detect if the OS is in dark mode in browsers?](https://stackoverflow.com/questions/50840168/how-to-detect-if-the-os-is-in-dark-mode-in-browsers) – Boaz May 22 '22 at 14:22
  • Please check the suggested duplicate. If this is indeed the issue, consider closing this question. If it's not, please add a short example demonstrating the issue. – Boaz May 22 '22 at 14:23
  • The answer in that link seems good for text but not for images. As I mentioned, if I had the image in any other section of the page it would show, But having it as a bkg image in the html makes the image disappear in dark mode. – D. V. May 22 '22 at 18:21
  • Please include a relevant example demonstrating the issue. – Boaz May 22 '22 at 18:36
  • Please excuse, I have files of my own where this problem occurs but nothing online to show it. To repeat, the simplest description of this is that images placed in a div, section, body, wrap, container, etc., do show up in dark mode. But if the image is placed in the background 'html' at the beginning of code, then image doesn't show in dark mode. Maybe I may have to cover the html with a another layer, such as 'container' and that might work. – D. V. May 22 '22 at 19:19
  • I had a similar issue. I added an appropriate CSS filter for the images in the mode that it disappears. – m4n0 May 22 '22 at 21:22
  • Could you please show a code example of how you used the filter? – D. V. May 23 '22 at 15:40

0 Answers0