Bootstrap网格溢出中心

时间:2016-07-18 02:12:10

标签: html css twitter-bootstrap

使用Bootstrap网格我已经制作了11个徽标的行。 11中的每一个都具有class =" col-md-2 col-xs-4",意味着2行用于" md"和#34; xs" 4行。

甚至可以将最后一排居中?我误解了网格吗?

1 个答案:

答案 0 :(得分:2)

例如,您可以使用offsetting columns 请检查结果。这是你想要实现的目标吗?

responsive layout

https://jsfiddle.net/glebkema/r98pj2s8/



.logos img {
  height: auto;
  margin-top: 20px;
  max-width: 100%;
}
.logos .row {
  text-align: center;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<div class="container logos">
  <div class="row">
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/c69/f9c/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/9c6/cf9/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/69c/9cf/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/3cc/6ff/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/c69/f9c/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/9c6/cf9/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2 col-md-offset-1"><img src="//placehold.it/80x80/69c/9cf/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/3cc/6ff/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/c69/f9c/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2 col-md-offset-0 col-xs-offset-2"><img src="//placehold.it/80x80/9c6/cf9/?text=logo" alt=""></div>
    <div class="col-xs-4 col-md-2"><img src="//placehold.it/80x80/69c/9cf/?text=logo" alt=""></div>
  </div>
</div>
&#13;
&#13;
&#13;