如何在邮件内联样式中使用!important?解决Outlook转发格式错乱
解决Outlook转发Mailchimp邮件排版混乱的问题
要阻止Outlook转发时覆盖原邮件样式,只需把!important直接追加到每个需要锁定的CSS属性值末尾(分号之前)。针对你提供的代码片段,修改后的版本如下:
<span style="color:rgb(255, 255, 255)!important;"><span style="font-size: 17px!important;"><span style="font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif!important;">I hope this message finds you well and that your academic year is off to a good start. </span></span></span></p> <p><span style="color:rgb(255, 255, 255)!important;"><span style="font-size: 17px!important;"><span style="font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif!important;"> </span></span> </span></p> <p><span style="color:rgb(255, 255, 255)!important;"><span style="font-size: 17px!important;">
额外注意事项
- 不止文字颜色、字体、字号,邮件中的背景色、行高、内边距/外边距等所有你不想被Outlook修改的样式,都可以按同样方式添加
!important - 由于Mailchimp生成的邮件采用内嵌样式(inline style),必须给每个独立的样式属性单独添加
!important,外部或内部样式块在Outlook中兼容性极差,无法起到锁定效果 - 修改后建议转发到不同版本的Outlook(桌面客户端、网页端)测试,部分旧版Outlook可能需要额外的兼容代码辅助
内容的提问来源于stack exchange,提问作者Abby May
相关产品推荐
相关产品推荐

