如何让bootstrap中的水平掠夺更小?

时间:2017-09-04 20:58:12

标签: html css twitter-bootstrap-3

我在bootstrap中创建了一个水平滚动列,但它在页面的最右边结束。我怎样才能将它们做得更小i want to be on the same level of row above

<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            ...
    </div>
    <div class="row">
    <div class="col-md-8 ">
            <div class="container testimonial-group">
               ...
            </div>
    </div>

</div>

css:

.testimonial-group > .row {

    overflow-x: auto;
    white-space: nowrap;
  }
  .testimonial-group > .row > .col-xs-4 {
    display: inline-block;

    float: none;
  }

  /* Decorations */
  .col-xs-4 { color: #fff; font-size: 48px; padding-bottom: 20px; padding-top: 18px; }
  .col-xs-4:nth-child(3n+1) { background: #c69; }
  .col-xs-4:nth-child(3n+2) { background: #9c6; }
  .col-xs-4:nth-child(3n+3) { background: #69c; }

2 个答案:

答案 0 :(得分:0)

如果理解你的问题是正确的 - 尝试在&#34; testimonial-group&#34;上设置css属性inline-block

答案 1 :(得分:0)

尝试删除容器类

<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            ...
    </div>
    <div class="row">
    <div class="col-md-8 ">
            <div class="testimonial-group">
               ...
            </div>
    </div>

</div>