0

我正在使用速度模板来格式化邮件正文。我有以下文件。

示例.vm

<html>
<body>

This is an error email<p/>  //This text should be in bold

${exceptionDetails} //This exception details should be in RED font.

</body>
</html>

如何将文本格式化为粗体,异常详细信息为红色?

请帮我。

谢谢!

4

2 回答 2

4

您应该使用样式声明来实现这一点。

像这样的东西:

<html>
<body>
<span style="font-weight:bold">
This is an error email<p/>  //This text should be in bold
</span>
<span style="color:red">
${exceptionDetails} //This exception details should be in RED font.
</span>
</body>
</html>

您可以在此处阅读有关此内容的更多信息。

当您使用 CSS 编写 HTML 电子邮件时,请确保您不使用链接的 CSS 文件(使用链接或 @import 附加的 .css 文件)。这些是电子邮件客户端最广泛忽略的样式表。

......

于 2013-10-21T14:11:16.940 回答
0

您可以使用内联样式,<p style="color:red">因为许多电子邮件客户端不支持 ... 标签(包括 GMail)。

http://www.htmlgoodies.com/beyond/css/article.php/3679231/How-to-Create-Great-HTML-Emails-with-CSS.htm

对于其他 html 格式,如粗体、斜体.. 查看此链接 http://www.w3schools.com/html/html_formatting.asp

于 2013-10-21T14:23:51.157 回答