15

由于我正在使用<span><p>标记内联样式,我应该只是去真正的老学校并使用<br><br>来打破段落而不是<p>每次都关闭和重新打开标签吗?

例如,这是我目前拥有的一段代码,它非常多余。我知道这是必须内联编码的本质,但似乎我可以通过这样做来减少一些噪音<br><br>

<p style="font-size: small; font-family:Tahoma, Geneva, sans-serif">Selection of the 200 New &amp; Recently updated companies over the last month. Click on the company name for up-to-date business information.</p>
<p style="font-size: small; font-family:Tahoma, Geneva, sans-serif">Company Name, FL provider of Category was updated on 2/12/2013</p>
<p style="font-size: small; font-family:Tahoma, Geneva, sans-serif">Company Name, TX provider of Category was updated on 2/13/2013</p>
<p style="font-size: small; font-family:Tahoma, Geneva, sans-serif">Company Name, AK provider of Category was updated on 2/15/2013</p>

在适用时切换其中的一些是否有不利之处<br><br>?电子邮件客户端支持或类似的东西?

4

2 回答 2

11

随意使用换行标记,您已经非常正确地确定了以这种方式减少标记的潜力,并且这样做没有任何缺点。每个电子邮件客户端和 Web 客户端都支持它们,并且它们比在段落标签上使用边距更可靠,因为并非所有系统都全面支持边距。

参考: http: //www.campaignmonitor.com/css/

于 2013-02-28T14:25:33.017 回答
6

我在所有文本之间使用双<br>标签。这是电子邮件最一致的选项。

您需要将它与&nbsp;文本顶部和底部的虽然配对,因为它可以在某些客户端(我认为是 Outlook)中压缩空行。这是一个例子:

<td>
&nbsp;<br>
The no break space is needed above and below the text where it meets the table cell.
<br><br>
double br's between paragraphs are the best way to do it.
<br><br>
You need 1 no break space per line at the bottom (and top) so that Outlook doesn't remove the text row.
<br>&nbsp;<br>&nbsp;
</td>

这是最快的方法,但将您限制为行高的倍数。另一种选择是使用填充:

<td style="padding-top:15px; padding-bottom:30px;">
The no break space is needed above and below the text where it meets the table cell.
<br><br>
double br's between paragraphs are the best way to do it.
<br><br>
You need 1 no break space per line at the bottom (and top) so that Outlook doesn't remove the text row.
</td>

假设 line-height 设置为 15px,这两种方法将产生相同的结果,并且在所有主要电子邮件客户端中都得到广泛支持。

于 2013-03-01T16:40:41.857 回答