CS 0 Show/Hide images for Dark Mode Shared by Carin Slater, 2022-12-03 21:38:50. Tagged: Image, All Copy to Clipboard Save to Design Library Snippet Trigger View Design Library Please enter a valid trigger The text that, when typed and followed by a tab will trigger the insertion of the snippet code. Added to your Design Library. Go to Design Library. Copied to Clipboard Your snippet is out of date. Update snippet <!--Dark Mode image swap code. Works in Apple/iOS. Works on Outlook.com, but only if the images are linked--> <!--Styles--> <style> .dark-img { display: none !important; } @media (prefers-color-scheme: dark) { .dark-img { display: block !important; } .light-img { display: none !important; } } [data-ogsc] .dark-img { display: block !important; } [data-ogsc] .light-img { display: none !important; } </style> <!--HTML--> <a href=""><img class="light-img" src="https://via.placeholder.com/600x300" width="600" height="300" alt="" style="width: 100%; max-width: 600px; height: auto;" border="0" /> <!--[if !mso]><! --> <img class="dark-img" src="https://via.placeholder.com/600x300" width="600" height="300" alt="" style="width: 100%; max-width: 600px; height: auto;" border="0" /> <!--<![endif]--></a>