【问题标题】:bgcolor on td or tr table element - html emailtd 或 tr 表元素上的 bgcolor - html 电子邮件
【发布时间】:2015-07-26 09:00:50
【问题描述】:

我想尽量减少我的 html 电子邮件内联样式的臃肿,但尽可能多地保留客户端支持,想知道哪个更适合应用 bgcolor。

每个<td>,但有很多臃肿

<tr>
  <td bgcolor="#000000"></td>
  <td bgcolor="#000000"></td>
</tr>

PARENT &lt;tr&gt; 最小化但受支持?

<tr bgcolor="#00000">
  <td></td>
  <td></td>
</tr>

通过简短的测试,所有兄弟&lt;td&gt; 都继承了颜色,但想知道这有什么支持。以下article 提到了背景颜色,但没有提及&lt;tr&gt; 元素。

【问题讨论】:

  • 为什么不直接使用 css 来删除 html 中的所有臃肿?这一行为您的所有行着色:table &gt; tr { background-color:black;}
  • @Banana - 构建 html 电子邮件,并非所有电子邮件客户端都支持 css。最好内联样式

标签: html colors background html-table


【解决方案1】:

tr 将为每个 td 元素应用背景颜色 它受到高度支持。通常 tr 也用于确定奇数或偶数背景颜色。

<tr class="${(c % 2) == 0 ? 'even' : 'odd'}">


The <tr> tag defines a row in an HTML table. 

A <tr> element contains one or more <th> or <td> elements. color can
be applied to the row using bgcolor. bgcolor    rgb(x,x,x) #xxxxxx
colorname   Not supported in HTML5. Specifies a background color for a
table row

【讨论】:

    猜你喜欢
    • 2011-11-27
    • 1970-01-01
    • 1970-01-01
    • 2017-09-22
    • 1970-01-01
    • 2012-05-13
    • 1970-01-01
    • 2011-09-07
    • 2013-06-09
    相关资源
    最近更新 更多