html - HTML 电子邮件签名
问题描述
我正在尝试制作 HTML 电子邮件签名。
我已经设法让它看起来像我想要的那样,但是与 Outlook 网页版相比,在 Outlook 客户端中查看签名时似乎发生了一些奇怪的事情,请参见下图。
这就是在 Outlook 客户端中查看时的样子。
这是我的 HTML。
<html>
<body>
<img src="https://static1.squarespace.com/static/5755c2b9356fb0c7e2943cf6/t/58800e158419c2ec7abbbd80/1484787227067/TheTest_banner_r2.png?format=2500w" width="571" height="168">
<div class="links" style="font-size: 15px;">
<a href="#"><p>Test</p></a><p> | </p>
<a href="#"><p>Test</p></a><p> | </p>
<a href="#"><p>Test</p></a><p> | </p>
<a href="#"><p>Test</p></a><p> | </p>
<a href="#"><p>Test</p></a><p> | </p>
<a href="#"><p>Test</p></a>
</div>
<p style="font-size: 11px;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. <br/>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
</body>
</html>
这是我的CSS。
p {
font-family: Georgia;
color: rgb(22, 31, 53);
}
a {
color: rgb(22, 31, 53);
}
.links p {
color: rgb(22, 31, 53);
display: inline;
}
解决方案
好吧,看来 Outlook 不喜欢更改显示属性。我稍微改变了你的代码,所以它使用span元素而不是段落,所以它们自然地按照你想要的方式对齐,而不使用 display 属性。
这是原始的(没有内联的css):
body {
font-family: Georgia;
color: rgb(22, 31, 53);
}
.links {
color: rgb(22, 31, 53);
}
.links .link-text {
color: rgb(22, 31, 53);
}
<!DOCTYPE html>
<html>
<body>
<img src="https://static1.squarespace.com/static/5755c2b9356fb0c7e2943cf6/t/58800e158419c2ec7abbbd80/1484787227067/TheTest_banner_r2.png?format=2500w" width="571" height="168">
<div class="links" style="font-size: 15px;">
<a href="#"><span class="link-text">Test</span></a><span> | </span>
<a href="#"><span class="link-text">Test</span></a><span> | </span>
<a href="#"><span class="link-text">Test</span></a><span> | </span>
<a href="#"><span class="link-text">Test</span></a><span> | </span>
<a href="#"><span class="link-text">Test</span></a><span> | </span>
<a href="#"><span class="link-text">Test</span></a>
</div>
<p style="font-size: 11px;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. <br/>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
</body>
</html>
这是一个内联版本,我使用 Office365 Outlook 客户端进行了测试:
body {
font-family: Georgia;
color: rgb(22, 31, 53);
}
.links {
color: rgb(22, 31, 53);
}
.links .link-text {
color: rgb(22, 31, 53);
}
<!DOCTYPE html>
<html>
<body style="font-family: Georgia;color: rgb(22, 31, 53);">
<img src="https://static1.squarespace.com/static/5755c2b9356fb0c7e2943cf6/t/58800e158419c2ec7abbbd80/1484787227067/TheTest_banner_r2.png?format=2500w" width="571" height="168">
<div class="links" style="font-size: 15px;color: rgb(22, 31, 53);">
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a><span> | </span>
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a><span> | </span>
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a><span> | </span>
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a><span> | </span>
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a><span> | </span>
<a href="#"><span class="link-text" style="color: rgb(22, 31, 53);">Test</span></a>
</div>
<p style="font-size: 11px;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. <br>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
</body>
</html>
注意:您的 CSS 更改颜色是多余的。我将它保留为使用新元素,以防您以后想将它们更改为真正有意义的东西。
推荐阅读
- sqlite - 如何编写在 Flutter/moor 中返回 Future 的 cotomselect 查询
- angular - 检测角度应用程序何时访问外部 URL(不在路由器中)
- sql - 如何选择具有多个条件的值
- python - 如何合并 0 或 1 的字符串,就好像我在 python 中的位域上做 OR 一样?
- ruby-on-rails - 在 Rails 中从 Amazon S3 播种多个图像附件
- c++ - C++ 拍摄 hwnd 的快照在内部生成白色矩形
- c# - 如何在 .NET WEB API 中处理多个请求
- wordpress - 在 JetEngine Forms 中,提交/条目存储在哪里?
- xml - 如何找到当前 XSL 文件所引用的 XML 文件?
- testing - 如何模拟对象映射器