理由 - 内容 - 中心不工作?

时间:2017-07-13 13:00:55

标签: html twitter-bootstrap

我正在学习教程,并且当它达到中等屏幕尺寸时我想使用justify-content-md-center。但它似乎没有用。

 <div class="container">
    <div class="row" style="background:lightblue">
      <div class="col-md-2">col-sm-6</div>
      <div class="col-md-8">col-sm-6</div>
      <div class="col-md-2">col-sm-6</div>
    </div>
      <div class="row justify-content-md-center">
        <div class="col-md-2">col-sm-2</div>
        <div class="col-md-2">col-sm-2</div>
        <div class="col-md-2">col-sm-2</div>
      </div>

  </div>

感谢帮助谢谢

1 个答案:

答案 0 :(得分:2)

希望这有效

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
   

<div class="row justify-content-center" style="background: darkgray;">
  <div class="col-xs-2">
    <img src="https://placehold.it/150x150" alt="sample image">
  </div>
  
  <div class="col-xs-2">
    <img src="https://placehold.it/150x150" alt="sample image">
</div>
</div>