【发布时间】:2019-08-02 02:50:55
【问题描述】:
我的电子邮件模板有两个媒体查询。我有一个号召性用语按钮作为图像。当代码在 Outlook 中呈现时,较大媒体查询中的图像按钮看起来不错,但在较小媒体查询中的图像宽度x高度在 Outlook 中查看呈现的电子邮件时不会改变它确实为其他邮件客户端、操作系统呈现良好)。图片的原生大小是 CSS 中声明的 2 倍。
我试过了——
CSS 中的最大宽度。 HTML 中的 width 属性(但这适用于所有媒体查询)。
CSS -
@media screen {
.image-responsive {
width: 320px;
height: 68px;
}
@media (max-width: 520px) {
.image-responsive {
width: 260px;
height: 56px;
max-width: 260px;
}
HTML -
<p style="text-align: right;margin: 0;padding-top: 20px;">
<a href="#" style="color:#fff; text-decoration: none;">
<img src="URL/images/btn-securepayment-2x.png" alt="Secure Payment" class="image-responsive">
</a>
</p>
【问题讨论】:
标签: outlook html-email