我正在为我的公司制作电子邮件 HTML 文档
除了要显示的一组图像外,一切都很好。 在 Office 上,它们看起来很好,但在 Gmail 上,它们是隐藏的,当我在检查器中查看 HTML 时,我看到 style="display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 300 像素 32 像素;"已添加到图像中。
有谁知道这是为什么以及我该如何阻止它。
<table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff">
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 1px solid #45b75c;">
<tr style="border: 1px solid #45b75c">
<td align="center" width="155" height="155" style="background-color: #f3f1f1;">
<img src="https://www.soccerhubb.com/assets/img/emails/world-cup/advert1.png" width="115" height="115" alt="Advertise to your target audience" line-height="" style="display: block;"/>
</td>
<td align="center">
<p style="text-align: center; font-size: 24px; color: #45b75c;">
Advertise to your target audience<br />
with intelligent analytics
</p>
</td>
</tr>
</table>
</td>
</tr>
<table>
最佳答案
使用 style 标签并通过 display:block 应用样式 !important 在 css 中 !important 关键字用于覆盖所有样式
关于html - 为 Gmail 构建电子邮件,我的 <img> 一直设置为隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24209496/