---
title: "Discussion on \"Light and dark mode image in HTML\" | Hashnode"
description: "Discussion on \"Light and dark mode image in HTML\". Did you know you can change images bases on the user preferred Color-scheme?\nThis nifty piece of code could already be used in CSS, but did you know it works directly in HTML?\nWe can detect if the user prefers a dark or light color schema and show a ..."
url: "https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Light and dark mode image in HTML](https://h.daily-dev-tips.com/light-and-dark-mode-image-in-html?utm_source=hashnode&utm_medium=feed)

Did you know you can change images bases on the user preferred Color-scheme? This nifty piece of code could already be used in CSS, but did you know it works directly in HTML? We can detect if the user prefers a dark or light color schema and show a ...

Oct 29, 2020 · 1 min read · h.daily-dev-tips.com  
Read the article

-   [#html](https://hashnode.com/tag/html)
-   [#html5](https://hashnode.com/tag/html5)
-   [#programming](https://hashnode.com/tag/programming)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#developer](https://hashnode.com/tag/developer)

## Written by

[Chris Bongers](https://hashnode.com/@dailydevtips)

@dailydevtips · Cape Town, SA

  
[View profile](https://hashnode.com/@dailydevtips)

Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.

## Responses 3

Markdown supported · ⌘↵ to post

[Shreyasi Patil](https://hashnode.com/@error404_sp)

[Oct 30, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9bd3811502575c971274bb)

This is awesome!!!!

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Oct 30, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9bd3811502575c971274bb#reply-5f9bdca51502575c9712753d)

Thank you Shreyasi! I'm glad you found this useful 🤟 And thanks for sharing this.

[Ritvik Dubey](https://hashnode.com/@ritvikdubey27)

[Oct 29, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9aa302a1658252d1a7b4b9)

This is amazing 🤩

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Oct 29, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9aa302a1658252d1a7b4b9#reply-5f9aaae8a1658252d1a7b55f)

Hey Ritvik, cool this is supported in HTML right!

[Vivek Tiwari](https://hashnode.com/@vivek566)

[Oct 29, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9a4b1aae41043093cdbe4b)

It's today's TIL for me.

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Oct 29, 2020](https://hashnode.com/posts/light-and-dark-mode-image-in-html/5f9a49901646ee3072b6e153/comment/5f9a4b1aae41043093cdbe4b#reply-5f9a6af51646ee3072b6e3dc)

Nice Vivek glad you learned something new today 🤟
