当我在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>
最佳答案
在 Outlook 中或通过浏览器呈现时事通讯是非常不同的。
如果您想在您的电子邮件客户端中正确显示它,您必须像 1999 一样进行编码并将所有内容内联。
修复您的 <h1>
,您应该比现在更多地指定样式方式:
<h1 style="font-size: 20px; font-family: Arial; font-weight: normal;line-height: 1; color: #000000;">Heading 1</h1>
例如。
这里有一些文章可以帮助您入门并熟悉正确的 HTML 电子邮件编码:
- > Coding your emails 它是如何工作的?
- > The Foundations of Coding HTML Email 它是如何工作的?
- > Email Coding Guidelines 怎么办?
- > The Ultimate Guide to CSS 支持什么?
关于html - Outlook 中的字体太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36458399/