Bootstrap表格样式

来源:2-17 表格

qianqianQ

2016-09-16 22:17

class="table table-striped"斑马线表格类里为啥要加 table 不是 直接 table-striped吗 有疑问 求解答

写回答 关注

1回答

  • 飞过那座山
    2016-09-16 23:06:48
    已采纳

    .table这个类是设置表格的基本信息。

    就例如这段,很多是基于.table这个类进行装饰表格。

    .table {
      width: 100%;
      max-width: 100%;
      margin-bottom: 20px;
    }
    .table > thead > tr > th,
    .table > tbody > tr > th,
    .table > tfoot > tr > th,
    .table > thead > tr > td,
    .table > tbody > tr > td,
    .table > tfoot > tr > td {
      padding: 8px;
      line-height: 1.42857143;
      vertical-align: top;
      border-top: 1px solid #ddd;
    }
    ...

    而.table-striped这个类是基于.table这个类上进行修饰的,只是修饰的方向不同

    .table-striped > tbody > tr:nth-of-type(odd) {
      background-color: #f9f9f9;  //只是起到添加背景的效果
    }


    qianqi...

    非常感谢!

    2016-09-16 23:51:05

    共 1 条回复 >

玩转Bootstrap(基础)

告诉你使用Bootstrap,并且能够独立定制出适合自己的Bootstrap

314559 学习 · 2357 问题

查看课程

相似问题