gpt4 book ai didi

html - 适合所有电子邮件客户端和浏览器的图像标题

转载 作者:行者123 更新时间:2023-11-28 06:58:31 26 4
gpt4 key购买 nike

这里有什么 secret ?我有位于电子邮件顶部的图像。它是一个全宽的矩形条。但它在 gmail 和 outlook 中都存在,但在邮件客户端 (mac) 中它工作得很好。(图片是你在下面看到的黑条)

enter image description here

<html>
<head>
<style>
td{
font-size:1.2em;
line-height:2;
}
.footer_add{
font-size:0.9em;
margin-top:2em;
line-height:1;
}
.footer_content{
font-size:0.9em;
line-height:1;
}
.footer_contactus{
font-size:0.9em;
line-height:1;
}
</style>
</head>
<body style="background-color: whitesmoke;">
<div style="margin-top:-3em;">
<img src="cid:email-header">
</div>
<table>
<tr>
<td>
<table>
<tr><td style="overflow:hidden;height:0.5em"></td></tr>
<tr>
<td><?php echo(COUNT_MSG_0. $receipient_display_name)?></td>
<td></td>
</tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr>
<td style="align:justify"><?php echo(COUNT_MSG_14.$sender_display_name.". ".COUNT_MSG_15); ?></td>
</tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td><?php echo(COUNT_MSG_17);?></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr>
<td style="line-height:1"><?php echo(COUNT_MSG_6); ?></td>
</tr>
<tr>
<td style="line-height:1"><img src="cid:my-attach1" ><label style="font-family: Open Sans">Nottx</label></td>
</tr>
</table>
</td>
</tr>
</table>

</body>
<footer>
<p class="footer_add">&nbsp; </p>
<hr>
<p class="footer_content">&nbsp; </p>
<p class="footer_contactus">&nbsp; <?php echo(COUNT_MSG_99);?></p>
</footer>

enter image description here

最佳答案

您遇到的问题是实际图像尺寸超过 1300 像素宽。当设置为 100% 时,一些电子邮件客户端会将图像拉伸(stretch)到图像的实际大小(Outlook 是主要的罪魁祸首)。

最好的解决方案是使用表格而不是图像(如果它只是将要使用的单个彩色条)。您可以将宽度设置为 100%,将高度设置为您需要的任何值,它会比图像流畅得多,并且即使启用了图像阻止也会显示。

super 简化的例子:<table width="100%" bgcolor="yourgreycolor"><tr><td height="50" style="font-size:50px; mso-line-height-rule:exactly; line-height:100%;">&nbsp;</td></tr></table>

如果您需要它是一张图片,Outlook 将在没有定义宽度或将图片的实际大小设置为您希望它显示的最大宽度的情况下中断。

我可能会将它移到 div 之外,而不是移到下面的表格中(表格样式更加一致),并且我会确保在图像上包含 HTML“宽度”属性。 ( <img width="100%" src="... ) 并且可能在电子邮件中包含最大宽度。尽管在某些客户端中未读取最大宽度 (http://www.campaignmonitor.com/css)。

您的 HTML 和 CSS 存在一些其他问题,可能无法很好地转换为 HTML 电子邮件。请参阅下面的一些指南,了解如何设计和开发 HTML 电子邮件:

https://www.exacttarget.com/products/email-marketing/email-design-toolkit https://litmus.com/blog/html-email-coding-101-infographic http://templates.mailchimp.com/getting-started/html-email-basics/ http://www.sitepoint.com/how-to-code-html-email-newsletters/

关于html - 适合所有电子邮件客户端和浏览器的图像标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33365975/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com