我们有一个应用程序,打开一个新的基于自定义代码的Outlook 2013电子邮件。代码是
<img width="298px" height="28px" src="https://www.ahd.de/sites/default/files/logo_0.gif"/>但是Outlook使用以下内容打开电子邮件:
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-fareast-font-family:"Times New Roman";color:#6E6E6E;mso-no-proof:yes'><img
width=1024 height=768 id="_x0000_i1025"
src="https://www.ahd.de/sites/default/files/logo_0.gif"
alt="ahd your business. (Logo)"></span><span style='font-size:10.0pt;
font-family:"Arial",sans-serif;mso-fareast-font-family:"Times New Roman";
color:#6E6E6E'>有办法绕过这件事吗?这张照片在邮件中的比例非常离谱。
注意:有趣的是,当我关闭Outlook窗口并通过我们的应用程序重新打开它时,代码仍然被更改,但是宽度和高度都是正确的!
谢谢你的帮忙!
发布于 2016-12-19 04:01:28
每次我们为电子邮件模板编写代码时,我们都应该始终遵循内联CSS,如果我们想要使用图像,那么我们必须遵循这种特殊的方式(即OP情况):
<img alt="your alt text" border="0" height="28" src="https://www.ahd.de/sites/default/files/logo_0.gif" style="width: 298px; height:28px;line-height: 100%;outline: none;text-decoration: none;display: inline;margin: 0px;border: 0;" width="298" />这背后的主要原因是:
alt文本border设置为零,以避免大多数邮件客户端设置不必要的边框。height和width,即使用内联CSS以及使用图像标记attributes将图像覆盖的区域限制在所有平台的实际尺寸上。希望这能让你明白。
https://stackoverflow.com/questions/41183301
复制相似问题