带有背景颜色的单元格:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td bgcolor="#FF0000">January</td>
<td bgcolor="#00FF00">$100.00</td>
</tr>
</table>
bgcolor 属性规定单元格的背景颜色。
尽管不赞成使用 bgcolor 属性,但是所有浏览器都支持它。
在 HTML 4.01 中,不赞成使用 td 元素的 bgcolor 属性;在 XHTML 1.0 Strict DTD 中,不支持 td 元素的 bgcolor 属性。
请使用 CSS 代替。
CSS 语法:<td style="background-color:red">
在我们的 CSS 教程中,您可以找到更多有关 background-color 属性的细节。
<td bgcolor="value">
| 值 | 描述 |
|---|---|
| color_name | 规定颜色值为颜色名称的背景颜色(比如 "red")。 |
| hex_number | 规定颜色值为十六进制值的背景颜色(比如 "#ff0000")。 |
| rgb_number | 规定颜色值为 rgb 代码的背景颜色(比如 "rgb(255,0,0)")。 |
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号