【问题标题】:Outlook in darkmode messes with the css深色模式下的 Outlook 与 css 混淆
【发布时间】:2019-10-02 12:43:33
【问题描述】:

我有一个电子邮件模板,我想要一个浅色背景。 但是黑暗模式中的 Outlook 将 css 弄乱了。当然,outlook 中有一个“打开灯”的开关,但我希望一直有白色背景,因为收到电子邮件的每个人都不知道如何进行该开关。

我尝试将bgcolor添加到table标签和td标签,并将backgroundColor添加到内联样式,但没有成功。

我还尝试强制按钮在暗模式下具有相同的黄色,但无论如何它都会切换。 我也尝试搜索互联网,但找不到任何涵盖 Outlook 暗模式的内容。

https://litmus.com/blog/email-designers-next-challenge-apple-dark-mode

<table bgcolor="#ffffff" style="width:70%;" align="center" border="0"      cellspacing="0" cellpadding="0">    <tbody>      <tr>        <td bgcolor="#ffffff">

<tr>
                        <td align="center" style="
                            display: inline-block;
                            background-color: #ffdd00;
                            border-radius: 3px;
                            padding: 18px 0px;
                            width: 100%;
                            text-align: center;
                            cursor: pointer;
                            ">
                          <a href="https://my.hogia.se" target="_blank" style="
                             text-decoration: none;
                             text-transform: uppercase;
                             color: #000;
                             font-family: Lato, Trebuchet, Verdana, Tahoma, Lucida Sans Unicode, Arial;
                             font-weight: 700;
                             font-size: 14px;
                             letter-spacing: 0.0625em;">Kom igång</a>
                        </td>
                      </tr>

标准模式:

黑暗模式:

【问题讨论】:

  • 你在body标签上试过bgcolor和/或background-color吗?
  • 我都试过了。
  • 请添加您的代码,以便我们正确查看。没有代码就像在黑暗中拍摄(模式)
  • 哈哈“在黑暗中(模式)”:D。那么我提供的代码是围绕内容的元素,其余的与背景无关。我也可以为按钮提供代码以及它如何获得颜色,但是因为“暗模式”接管了问题,所以 Outlook 如何在暗模式下处理颜色以及如何弥补它。
  • 对于任何读过这篇文章的人,我让它在带有 !important 标志和样式标签的 Outlook 暗模式下工作,如下所示: .lightTheme { background: #ffffff !important;颜色:#000 !重要; } 但是Win10 Mail DarkMode 不行,还是一样。

标签: html-email email-client


【解决方案1】:

无法覆盖 Outlook365 和 Outlook.com 暗模式,因为 Microsoft 将 !important 内联添加到它找到的每个背景颜色,包括系统。我想他们是在 2021 年 6 月添加的。

【讨论】:

    猜你喜欢
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-16
    • 1970-01-01
    相关资源
    最近更新 更多