<legend id='qVF9x'><style id='qVF9x'><dir id='qVF9x'><q id='qVF9x'></q></dir></style></legend>

    <i id='qVF9x'><tr id='qVF9x'><dt id='qVF9x'><q id='qVF9x'><span id='qVF9x'><b id='qVF9x'><form id='qVF9x'><ins id='qVF9x'></ins><ul id='qVF9x'></ul><sub id='qVF9x'></sub></form><legend id='qVF9x'></legend><bdo id='qVF9x'><pre id='qVF9x'><center id='qVF9x'></center></pre></bdo></b><th id='qVF9x'></th></span></q></dt></tr></i><div id='qVF9x'><tfoot id='qVF9x'></tfoot><dl id='qVF9x'><fieldset id='qVF9x'></fieldset></dl></div>

    <small id='qVF9x'></small><noframes id='qVF9x'>

    • <bdo id='qVF9x'></bdo><ul id='qVF9x'></ul>

    1. <tfoot id='qVF9x'></tfoot>
    2. 如何在 Gmail 的响应式电子邮件中使用 @media(首选颜色方案)?

      How to use @media (prefers-color-scheme) in responsive email in Gmail?(如何在 Gmail 的响应式电子邮件中使用 @media(首选颜色方案)?)
      • <bdo id='QQ45s'></bdo><ul id='QQ45s'></ul>

                <tfoot id='QQ45s'></tfoot>
              • <i id='QQ45s'><tr id='QQ45s'><dt id='QQ45s'><q id='QQ45s'><span id='QQ45s'><b id='QQ45s'><form id='QQ45s'><ins id='QQ45s'></ins><ul id='QQ45s'></ul><sub id='QQ45s'></sub></form><legend id='QQ45s'></legend><bdo id='QQ45s'><pre id='QQ45s'><center id='QQ45s'></center></pre></bdo></b><th id='QQ45s'></th></span></q></dt></tr></i><div id='QQ45s'><tfoot id='QQ45s'></tfoot><dl id='QQ45s'><fieldset id='QQ45s'></fieldset></dl></div>
                  <tbody id='QQ45s'></tbody>

                <small id='QQ45s'></small><noframes id='QQ45s'>

                <legend id='QQ45s'><style id='QQ45s'><dir id='QQ45s'><q id='QQ45s'></q></dir></style></legend>
              • 本文介绍了如何在 Gmail 的响应式电子邮件中使用 @media(首选颜色方案)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                以下 CSS 位于 HTML 电子邮件的 head 中,以在设备处于深色模式时更改电子邮件正文颜色.

                Following CSS is in head of HTML email to change email body color when the device in dark mode.

                @media (prefers-color-scheme: dark) {
                  .white-cont {
                    background: red !important;
                  }
                }
                

                它只在苹果邮件应用程序中转换电子邮件正文.Gmail 应用程序什么都不做,整个邮件会自动转换为深色方案,这不太好.

                It turns body of email only in apple mail app. Gmail app does nothing the entire mail is converted to dark color scheme automatically which is not so good.

                如何使 gmail 电子邮件具有暗模式响应功能?为什么上面的标签在 gmail 中不起作用?有什么解决办法吗?

                How to make dark-mode-responsive a gmail email? Why the above tag does not work in gmail? Any solutions?

                推荐答案

                深色模式是电子邮件开发的一种趋势,它为电子邮件呈现更深的调色板,使其更适合低光环境.IOS、Android OS、MacOS Mojave 和更新版本以及 Outlook 2019 中的一些电子邮件客户端支持深色模式.

                Dark Mode is a trend in email development to present a darker color palette for email to make it more suitable in low-light environments. Dark Mode is supported by some email clients in IOS, Android OS, MacOS Mojave and newer and Outlook 2019.

                启用深色模式后,电子邮件本质上会反转颜色.曾经是白色的背景变暗(通常是十六进制颜色#333,深色的文本变亮.但是,并非所有内容都以预期的方式交换.图像和图块上的背景保持不变,看起来……关闭.更重要的是,没有两个电子邮件客户端采用相同的方法来呈现暗模式,因此需要实施一些创造性的解决方案,以使电子邮件继续按照开发人员的预期呈现.

                With Dark Mode enabled, the email in essence inverts colors. Backgrounds that used to be white become dark (usually hexadecimal color #333, text that was dark becomes light. However, not everything swaps in a manner that is expected. Backgrounds on images and tiles remain the same, which looks ... off. To add to the issue, no two email clients are taking the same approach to present Dark Mode, so a few creative solutions need to be implemented so that emails continue to look as expected by the developer.

                坏消息是,我们无法通过 @media 查询或为 Gmail 或 Outlook 生成的类名在电子邮件中通过 CSS 专门针对暗模式.Gmail 会替换 <style> 工作表中的颜色值,Outlook 将内联深色模式颜色值并向它们添加 !important 并使其无法在 <style> 表格.

                The bad news is that we cannot specifically target Dark Mode via CSS in email via @media query or generated class name for Gmail or Outlook. Gmail replaces color values in the <style> sheet and Outlook will inline Dark Mode color values and adds an !important to them and makes it impossible to override it in the <style> sheet.

                解决方案

                在 Google 和 Microsoft 提供解决方案之前,最好的方法是接受这是一个现实,并设计出无论用户选择何种背景颜色来查看它们都可以正常工作的电子邮件.越来越多的用户正在采用深色模式,因此它只会在未来变得更加流行.

                Until Google and Microsoft offer a solution, the best approach forward is to accept this is a reality and design emails that work no matter what the background color the user chooses to view them. More users are adopting Dark Mode, so it's only going to become more popular going forward.

                祝你好运.

                这篇关于如何在 Gmail 的响应式电子邮件中使用 @media(首选颜色方案)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Move link image 5px up on hover(悬停时将链接图像向上移动 5px)
                How do I inspect CSS pseudo classes with firebug?(如何使用 firebug 检查 CSS 伪类?)
                Why doesn#39;t CSS hover work on table rows when the cells inside the rows have class names?(当行内的单元格具有类名时,为什么 CSS 悬停在表格行上不起作用?)
                Hover image - display div over it(悬停图像 - 在其上显示 div)
                How to apply a CSS class on hover to dynamically generated submit buttons?(如何在悬停时将 CSS 类应用于动态生成的提交按钮?)
                Differences between CSS3 :hover and :focus?(CSS3 :hover 和 :focus 的区别?)
                  <tbody id='TEbkO'></tbody>

                  <legend id='TEbkO'><style id='TEbkO'><dir id='TEbkO'><q id='TEbkO'></q></dir></style></legend>

                  <small id='TEbkO'></small><noframes id='TEbkO'>

                    <tfoot id='TEbkO'></tfoot>

                        <bdo id='TEbkO'></bdo><ul id='TEbkO'></ul>

                        • <i id='TEbkO'><tr id='TEbkO'><dt id='TEbkO'><q id='TEbkO'><span id='TEbkO'><b id='TEbkO'><form id='TEbkO'><ins id='TEbkO'></ins><ul id='TEbkO'></ul><sub id='TEbkO'></sub></form><legend id='TEbkO'></legend><bdo id='TEbkO'><pre id='TEbkO'><center id='TEbkO'></center></pre></bdo></b><th id='TEbkO'></th></span></q></dt></tr></i><div id='TEbkO'><tfoot id='TEbkO'></tfoot><dl id='TEbkO'><fieldset id='TEbkO'></fieldset></dl></div>