You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Outlook自动清除邮件按钮自定义颜色问题求助

解决Outlook邮件按钮颜色被重置为白色的问题

问题核心在于Outlook桌面版本不依赖标准CSS渲染按钮,而是靠**VML(矢量标记语言)**元素实现。你的代码里已经有针对MSO(Microsoft Office)的条件注释块,但仅修改<a>标签的background-color没用——Outlook会优先读取VML元素里的fillcolor属性,所以始终显示白色。

修复步骤:

  • 定位代码中<!--[if mso]>到<![endif]-->之间的<v:roundrect>标签
  • 将标签内的fillcolor="#ffffff"替换为目标颜色(比如红色#E53E3E、蓝色#3182CE)
  • 同步修改<a>标签的background-color,确保其他邮件客户端显示一致

修改后的按钮代码示例(以绿色按钮为例):

<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://www.blank.com" fillcolor="#38A169" arcsize="125%" stroke="f" style="width:222px;height:40px;v-text-anchor:middle;">
  <w:anchorlock/>
  <center class="customFont" style="font-family:'poppins',Helvetica,sans-serif;font-size:13px;font-weight:600;color:#101820;">SHOP NOW</center>
</v:roundrect><![endif]-->
<a href="https://www.blank.com" target="_blank" style="background-color:#38A169;border:0;border-radius:50px;display:inline-block;text-decoration:none;text-align:center;width:222px;mso-hide:all;border-radius:50px;"><span style="color:#101820;font-family:'poppins',Helvetica,sans-serif;font-size:13px;-webkit-text-size-adjust:none;font-weight:600;line-height:40px;">SHOP NOW</span></a>

额外提示:

  • 若需要按钮边框,可将<v:roundrect>的stroke="f"改为stroke="t",并添加strokecolor属性,同时同步设置<a>标签的border样式
  • 修改后务必在Outlook客户端测试,不同版本可能存在细微渲染差异

内容的提问来源于stack exchange,提问作者SpudCentric

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 14:47:12