【发布时间】:2020-10-02 17:56:33
【问题描述】:
我已经看到很多关于这个问题的答案,使用相对和绝对定位、使行高非常小等来达到我正在寻找的效果。由于我正在尝试为电子邮件开发相同的东西,所以这并不简单。我可以在标题的任一侧实现一行,但不能实现两行。从本质上讲,它看起来像 -----我的标题---- 这是我在任一侧的一行代码
<tr>
<td valign="top" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; table-layout: fixed; width: 100%; margin: 0 auto; padding-bottom: 20px;">
<a href="#" style="display: block; word-wrap: break-word; max-width: 100%; text-decoration: none; height: 100%; margin: 0 auto;">
<div class="header" style="display: table; text-align: center; margin: 0 auto; color: #000000; font-weight: 600; line-height: 130%; letter-spacing: 0.2px; font-size: 18px; width: 100%; max-width: 550px;">
<span style="display: table-cell; width: 20%; vertical-align: middle; padding-right: 10px;"><hr style="background-color: #000000; height: 3px;" /></span>MY HEADER
<span style="display: table-cell; width: 20%; vertical-align: middle; padding-left: 10px;"><hr style="height: 3px; background-color: #000000;" /></span>
</div>
</a>
</td>
</tr>
如果没有运行,我可能打错了。但无论哪种方式,在 gmail 中它都呈现得很好。
但是如果两边各有两条线,怎么办呢?我完全不知道如何在电子邮件中做到这一点。任何建议都会很棒 - 谢谢!
【问题讨论】:
标签: html css html-email