Outlook 中的电子邮件 html 字体大小
<div style="font-family: Arial; font-size: 10px;">TEST</div>
我将上述源代码作为 html 电子邮件提供给 Outlook 2007,它呈现 7.5px 字体。我需要什么技巧才能完成这项工作,有什么想法吗?
编辑:我正在使用 body
设置邮件内容,例如:
new MailMessage
{
IsBodyHtml = true,
Body = "<div style=\"font-family: Arial; font-size: 10px;\">TEST</div>"
};
但我不认为这是相关的。请注意,如果我查看生成的电子邮件中的源代码,则 html 符合预期。问题似乎只是 Outlook 出于某种原因无法正确呈现它。
<div style="font-family: Arial; font-size: 10px;">TEST</div>
I'm providing the above source as an html email to Outlook 2007, and it's rendering 7.5px font. Any ideas of what hack I need to make this work?
Edit: I'm setting the mail contents with body
, like:
new MailMessage
{
IsBodyHtml = true,
Body = "<div style=\"font-family: Arial; font-size: 10px;\">TEST</div>"
};
I don't believe this is related though. Note that if I view source in the generated email the html is as expected. The problem seems to be only that outlook doesn't render it correctly for whatever reason.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是,大多数电子邮件程序对 CSS 的理解甚少(如果有的话)。尝试使用旧的非 CSS 方法指定字体详细信息。此方法已被弃用,但不幸的是,这是我们必须做的来设置电子邮件的样式。它还会阻止精确调整字体大小。
The issue is that most email programs understand very little, if any, CSS. Try specifying the font details using the old, non-CSS methods. This method is deprecated, but unfortunately it is what we have to do to style the emails. It also prevents exact sizing of fonts.
一些建议:
A few suggestions: