【问题标题】:How can I prevent the dark theme from breaking the CSS in my HTML emails?如何防止深色主题破坏我的 HTML 电子邮件中的 CSS?
【发布时间】:2023-01-08 08:39:16
【问题描述】:

创建 HTML 电子邮件时,某些客户端(例如 Gmail)可能会破坏您设置的 CSS。例如,您可以将 div 元素的背景颜色设置为 COLOR,将 p 标签设置为白色,但这些样式可能无法在某些电子邮件客户端中正确应用。

【问题讨论】:

    标签: html css email


    【解决方案1】:
    <div class="container">
        <div class="gmail-blend-screen">
            <div class="gmail-blend-difference">
                <p>Your text here</p>
            </div>
        </div>
    </div>
    
    .container {
        background-image: linear-gradient(COLOR, COLOR);
    }
    
    p {
        color:white;
    }
    
    u+.body .gmail-blend-screen {
        background: #000;
        mix-blend-mode: screen;
    }
    
    u+.body .gmail-blend-difference {
        background: #000;
        mix-blend-mode: difference;
    }
    

    更多详情:https://www.hteumeuleu.com/2021/fixing-gmail-dark-mode-css-blend-modes/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-17
      • 2014-10-24
      相关资源
      最近更新 更多