繁体   English   中英

从某些行中删除斑马条纹

[英]Remove zebra stripe from certain rows

我有一张桌子,目前我在行上进行斑马条纹,偶数和奇数行得通。 我的问题是我也有一个类,用于指示具有不同颜色样式的新行。 斑马条纹CSS似乎已经取代了这个新类,有没有解决的办法? 任何提示或建议表示赞赏,谢谢。

这是控制此表的一些CSS

   #table tbody tr:nth-child(odd){
    background-color: #cccccc; color:black;
     }
   #table tbody tr:nth-child(even){
   background: #EBEBEB; color: #7D7D7D;
    }
   #table tbody tr:nth-child(2n+1):hover{
        cursor:pointer;
        /* add gradient */
        background-color: #808080;
        background: -webkit-gradient(linear, left top, left bottom, from(#909090), to(#606060));
        background: -moz-linear-gradient(top, #909090, #606060);
        color: #dadada;
        font-weight: ;
    }
  #table tbody tr:nth-child(2n):hover{
        cursor:pointer;
        /* add gradient */
        background-color: #808080;
        background: -webkit-gradient(linear, left top, left bottom, from(#909090),        to(#606060));
        background: -moz-linear-gradient(top, #909090, #606060);
        color: #dadada;

    }
  .new {
    background-color: #760086;
    color:white;
       }

如果将用于斑马线行的CSS放在新创建的元素的代码之前,那么就可以了:

p:nth-child(2n+1){
    /*blah*/
}
p:nth-child(2n){
    /*blah*/
}
p.new{
    /*blah*/
}

现场演示: http//jsfiddle.net/DerekL/ZFcKs/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM