我无法让我的 table-stripe 类与我的 Bootstrap 框架一起使用。
这是我的 table 的实时预览。我在我的 HTML 中设置了 .table-striped 类,但它没有显示在输出中。
我究竟做错了什么?
最佳答案
你的html是错误的。您有一个 tbody
每行的标签,但 .table-striped
的 css依赖 tr:nth-child()
以不同的方式设置行的样式:
.table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th
修复您的 html,以便您有一个 tbody 进行迭代。
另外,我在您的资源中看到了 bootstrap.css 和 bootstrap.min.css。一个就够了。
关于twitter-bootstrap - 无法让 .table-striped 类工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16759789/