html - Outlook 中的字体太大

标签 html css email fonts outlook

当我在Outlook中打开以下邮件时(另存为email.eml,Outlook可以打开),字体太大。因为<span style="height:40px;">...</span> , Outlook 建议在浏览器中打开邮件。如果我这样做,就会使用正确的字体大小。 Outlook 中的缩放设置当然设置为 100%。如何让 Outlook 显示正确的字体大小?我要发送一份时事通讯,不希望每个使用 Outlook 的人都看到太大的字体。

Date: Wed, 6 Apr 2016 19:25:19 +0200
From: test@test.com
Message-ID: <e43845aa69c33b79a282f80ed658959d@www.test.com>
X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
To: test@test.com
Subject: Font size test

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Font size test</title><meta http-equiv="Content-type" content="text/html; charset=UTF-8"></head><body><h1 style="font: 20px Arial">Heading 1</h1>
<p style="font-size: 15px; font-family: Georgia">The font size is too large in Outlook!</p>
<span style="font: 10px 'Times New Roman'; height:40px;">This is a span with height, to make Outlook suggest opening the email in a browser.</span> </body></html>

enter image description here

最佳答案

在 Outlook 中或通过浏览器呈现时事通讯是非常不同的。

如果您想在您的电子邮件客户端中正确显示它,您必须像 1999 一样进行编码并将所有内容内联。

修复您的 <h1> ,您应该比现在更多地指定样式方式:

<h1 style="font-size: 20px; font-family: Arial; font-weight: normal;line-height: 1; color: #000000;">Heading 1</h1>

例如。

这里有一些文章可以帮助您入门并熟悉正确的 HTML 电子邮件编码:

关于html - Outlook 中的字体太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36458399/

相关文章:

javascript - 页面底部的粘性页脚问题

javascript - 源代码中 CSS 段和 JS 函数放置顺序的权衡

html - 使用 CSS 过渡来更改元素位置

html - Isotope + Wordpress 排版模式

javascript - 如何通过python从源页面中提取由javascript创建的隐藏标签

php - 将变量值从 JS 传递到 PHP

javascript - 在 Internet Explorer 中使用 calc 转换翻译属性不起作用

powershell - 在 PowerShell 中,有没有办法处理 Send-MailMessage 资源?

iPhone - MessageUI 框架泄露?

java - 在java中替换电子邮件地址的用户部分