I am working on a dark mode version of my website. I am trying to change the first section background image of the landing page to another image when the viewer uses dark mode, but can't manage to make it work. Here is what I tried so far:
Hi all!
I am working on a dark mode version of my website. I am trying to change the first section background image of the landing page to another image when the viewer uses dark mode, but
You got wrong id of the section, use this extension to find correct id
Chrome Web Store - Extensions (google.com)
@media (prefers-color-scheme: dark) {
section[data-section-id="5f0cddf0
Question
TOMweb 7
Hi all!
I am working on a dark mode version of my website. I am trying to change the first section background image of the landing page to another image when the viewer uses dark mode, but can't manage to make it work. Here is what I tried so far:
@media (prefers-color-scheme: dark) { [data-section-id="5feca0a7dc82f97fd38e575d"] .section-background img { visibility: hidden; } /* set new image */ [data-section-id="5feca0a7dc82f97fd38e575d"] .section-background { background-image: url(https://static1.squarespace.com/static/5f0cd7575142de45f1d531a7/t/5feca8261d1415656f7995fb/1609345064730/WEBtransats_landingpage_night_123020.jpg); background-size: cover; background-repeat: no-repeat; background-position: center center; } } }
Any help is appreciated.
Thank you!
Edited by TOMwebLink to post
Top Posters For This Question
2
1
Popular Days
Dec 30
3
Top Posters For This Question
TOMweb 2 posts
bangank36 1 post
Popular Days
Dec 30 2020
3 posts
Popular Posts
TOMweb
Hi all! I am working on a dark mode version of my website. I am trying to change the first section background image of the landing page to another image when the viewer uses dark mode, but
bangank36
You got wrong id of the section, use this extension to find correct id Chrome Web Store - Extensions (google.com) @media (prefers-color-scheme: dark) { section[data-section-id="5f0cddf0
TOMweb
Right on! Thank you 🙂
Posted Images
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment