nav*_*een 24 html css html-table html-email
我们希望在电子邮件中显示订单详细信息
?<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>blah blah</td>
<td>blah blah</td>
<td>blah blah</td>
</tr>
</tbody>
</table>???????????????????????????????????????????
Run Code Online (Sandbox Code Playgroud)
理想情况下,我们希望标题的背景颜色为"#5D7B9D",文本颜色为"#fff".
我们正在使用bgcolor='#5D7B9D'更改背景颜色,并且无法找到替换方法来更改文本颜色.
由于大多数电子邮件提供商剥离了CSS,我们根本无法使用style属性.
问题是
Ryn*_*oRn 33
对于电子邮件模板,内联CSS是正确使用的样式方法:
<thead>
<tr style="color: #fff; background: black;">
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
Run Code Online (Sandbox Code Playgroud)
Sha*_*ora 30
你可以轻松地这样做: -
<table>
<thead>
<tr>
<th bgcolor="#5D7B9D"><font color="#fff">Header 1</font></th>
<th bgcolor="#5D7B9D"><font color="#fff">Header 2</font></th>
<th bgcolor="#5D7B9D"><font color="#fff">Header 3</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>blah blah</td>
<td>blah blah</td>
<td>blah blah</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
演示: - http://jsfiddle.net/VWdxj/7/
尝试使用<font>标签
?<table>
<thead>
<tr>
<th><font color="#FFF">Header 1</font></th>
<th><font color="#FFF">Header 1</font></th>
<th><font color="#FFF">Header 1</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>blah blah</td>
<td>blah blah</td>
<td>blah blah</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
但我认为这也应该有效:
?<table>
<thead>
<tr>
<th color="#FFF">Header 1</th>
<th color="#FFF">Header 1</th>
<th color="#FFF">Header 1</th>
</tr>
</thead>
<tbody>
<tr>
<td>blah blah</td>
<td>blah blah</td>
<td>blah blah</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
编辑:
Crossbrowser解决方案:
使用HEX颜色的大写字母.
<th bgcolor="#5D7B9D" color="#FFFFFF"><font color="#FFFFFF">Header 1</font></th>
Run Code Online (Sandbox Code Playgroud)