twitter-bootstrap justify-content-md-center 不起作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45081401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 00:55:46  来源:igfitidea点击:

justify-content-md-center not working?

htmltwitter-bootstrap

提问by Mr.Banks

I'm following a tutorial and I want to use justify-content-md-center when it reaches medium screen size. But it doesnt seem to work.

我正在学习教程,我想在达到中等屏幕尺寸时使用 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>

I appreciate the help thanks

我感谢帮助谢谢

回答by Dhruvang Gajjar

Hope this works

希望这有效

<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>