2022-06-22 554
HTML <tr> bgcolor 属性
实例
给第一个表格行添加背景颜色:
<table border="1"> <tr bgcolor="#FF0000"> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table>
所有主流浏览器都支持 bgcolor 属性。
定义和用法
HTML5 不支持 <tr> bgcolor 属性。请使用 CSS 代替。
在 HTML 4.01 中,<tr> 的 bgcolor 属性 已废弃。
bgcolor 属性规定表格行的背景颜色。
兼容性注释
在 HTML 4.01 中,<tr> 的 bgcolor 属性已废弃。请使用 CSS 代替。
CSS 语法:
<tr style="background-color:red">
CSS 实例:给表格行添加背景颜色
<table border="1"> <tr style="background-color:#FF0000"> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table>
在我们的 CSS 教程中,您可以找到更多有关 background-color 属性 的细节。
语法
<tr bgcolor="color_name|hex_number|rgb_number">
属性值
值 | 描述 |
color_name | 规定颜色值为颜色名称的背景颜色(比如 "red")。 |
hex_number | 规定颜色值为十六进制值的背景颜色(比如 "#ff0000")。 |
rgb_number | 规定颜色值为 rgb 代码的背景颜色(比如 "rgb(255,0,0)")。 |
原文链接:https://77isp.com/post/1414.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态