我试图创建一个响应电子邮件template.everything工作正常,除图像边框。 我为图片和媒体样式设置了边框,但在小屏幕中,图片边框将会被折叠。时事通讯边界错误
HTML
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<style type="text/css">
@media only screen and (max-width: 480px) {
.message_mobile {
width: 100% !important;
}
}
</style>
</head>
<body id="message_body" style="background-color:white;" >
<table style="border: 0px; border-collapse: collapse; border-spacing: 0px; width: 600px; display: table;" align="center" class="message_mobile"><tbody><tr>
<td align="left" valign="top">
<table cellpadding="0" cellspacing="0" style="border: 0px; border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: hidden;">
<tbody><tr>
<td style="vertical-align:top;text-align:center;">
<div>
<img src="http://www.myfico.com/Images/sample_overlay.gif" alt=" " style="border: 16px solid rgb(196, 45, 196); display: block; width: 100%; padding: 2px; max-width: 94.64882943143813%;" width="auto">
</div>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
输出(大屏幕)
输出(小画面)
为什么不使图像宽度稍微小一点,即90%; ?因为图像的宽度是:width + borderwidth因此最终宽度> 100% – user2211216
@ user2211216我们可以减小图像的宽度。但是宽度需要是响应 – Shin
,如果将它设置为89%,它可以正常工作,并且响应为 – user2211216