我正试图在我的电子邮件模板中添加对黑暗模式的支持,但是当涉及到Outlook时,我遇到了一个问题。由于某些原因,Outlook部分重写了“我的”按钮的背景,导致其显示错误:
该按钮的HTML如下:
<td align="center" style="word-break: break-word; font-family: "Nunito Sans", Helvetica, Arial, sans-serif; font-size: 16px;">
<a href="{{action_url}}" class="f-fallback button" target="_blank" style="color: #fff; border-color: #13c2c2; border-style: solid; border-width: 10px 18px; background-color: #13c2c2 !important; background-image: linear-gradient(#13c2c2, #13c2c2) !important; display: inline-block; text-decoration: none; border-radius: 3px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); -webkit-text-size-adjust: none; box-sizing: border-box;">Reset your password</a>
</td>
该按钮具有以下内联样式(为您的召集人设置格式):
color: #fff;
border-color: #13c2c2;
border-style: solid;
border-width: 10px 18px;
background-color: #13c2c2 !important;
background-image: linear-gradient(#13c2c2, #13c2c2) !important;
display: inline-block;
text-decoration: none;
border-radius: 3px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
-webkit-text-size-adjust: none;
box-sizing: border-box;
此外,我已经将以下内容添加到我的电子邮件的<head>
部分。
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />
谢谢!
发布于 2020-10-07 01:48:58
Outlook.com和Outlook (Windows/Mac/Android/iOS)将反转/调整大多数颜色,但出于某些原因,它们不调整边框颜色,这就是为什么<a>
标签的边框是原始颜色的原因,但<a>
的background-color
已被调整为暗模式。尝试使用border-color: transparent;
。
https://stackoverflow.com/questions/61657885
复制相似问题