"background-color"和"bgColor"用法上区别

background-color属于css样式表里面的所以这样写style="background-color:背景颜色"

bgColor属于HTML里面的所以这样写bgColor="背景颜色"

 

我的理解:

建议统一用样式的写法,在实现表格隔行变色的时候,在IE里把background-color改为bgcolor,就没效果

代码如下:

 

<style>

.tbDatalist tr{

    background-color:expression(this.background-color=((this.rowIndex)%2==0)?'#a5e5aa':'#d9ffdc');

   

    /* 以下写法在IE里可以,而且background-color不能改为bgcolor,但是在firefox里无效果

    background-color:expression((this.sectionRowIndex%2==0)?"#a5e5aa":"#d9ffdc")}

    */

}

</style>

<table class="tbDatalist" summary="list of members in EE Studay" id="oTable">

    <tr>

        <th scope="col">姓名</th>

        <th scope="col">班级</th>

        <th scope="col">出生日期</th>

        <th scope="col">星座</th>

        <th scope="col">电话</th>

    </tr>

    <tr>

        <td>slepox</td>

        <td> W19</td>

        <td>Nov 18th</td>

        <td>Scorpio</td>

        <td>0658635</td>

    </tr>

    <tr>

        <td>smartlau</td>

        <td>W19</td>

        <td>Dec 30th</td>

        <td>Capricorn</td>

        <td>0006621</td>

    </tr>

</table>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值