Bootstrap 表条纹:如何更改条纹背景颜色? [英] Bootstrap table striped: How do I change the stripe background colour?

查看:31
本文介绍了Bootstrap 表条纹:如何更改条纹背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Bootstrap 类 table-striped,表格中每隔一行的背景颜色等于 #F9F9F9.我怎样才能改变这种颜色?

With Bootstrap class table-striped, every other row in my table has a background colour equal to #F9F9F9. How can I change this colour?

推荐答案

.table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th {
   background-color: red;
}

在 bootstrap.css 中更改这一行或者你可以使用 (odd) 或 (even) 代替 (2n+1)

change this line in bootstrap.css or you could use (odd) or (even) instead of (2n+1)

这篇关于Bootstrap 表条纹:如何更改条纹背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆