我发送了两封简单的电子邮件,每封包含一张图片(50 像素高和 2 像素高)
<html>
<body>
<img src="http://placehold.it/600x50/00ff00"/>
<br />
Lorem ipsum
</body>
</html>
和
<html>
<body>
<img src="http://placehold.it/600x2/00ff00"/>
<br />
Lorem ipsum
</body>
</html>
这是 Outlook 2013 的结果
如您所见,左侧图像的顶部边距比右侧图像小 - 最顶部和左侧图像之间的边距是不可避免的 15px Outlook 默认边距 - 但我不是在谈论那个。
看起来 Outlook 为右边的图像添加了另一个边距,因为它小于大约 15px 的行高。
我已经尝试了所有可能的方法:设置 display: block
、line-height: 0
、mso-line-height-rule: exactly
等。我什至尝试将图像包装在 div
或 span
中,但没有任何帮助。
很容易重现,例如putsmail.com .
非常感谢任何想法或建议。
最佳答案
Outlook 使用 Word 作为电子邮件编辑器。您可以在以下系列文章中了解受支持和不受支持的 HTML 元素、属性和级联样式表属性:
- > Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 1 of 2)
- > Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 2 of 2)
希望这些信息对您有所帮助。
关于html - Outlook 为小于 15 像素的图像添加边距顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30035510/