我正在使用速度模板来格式化邮件正文。我有以下文件。
示例.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>
如何将文本格式化为粗体,异常详细信息为红色?
请帮我。
谢谢!
您应该使用样式声明来实现这一点。
像这样的东西:
<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 文件)。这些是电子邮件客户端最广泛忽略的样式表。
......
您可以使用内联样式,<p style="color:red">
因为许多电子邮件客户端不支持 ... 标签(包括 GMail)。
对于其他 html 格式,如粗体、斜体.. 查看此链接 http://www.w3schools.com/html/html_formatting.asp