我有这些div,我想在他们的容器中以4乘6格对齐。我有第一行的代码:
<div class="container-fluid">
<div class="swb col-xl-6 col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="row">
<div class="swb-button col-xs-3">
<p class="swb-button-name">1</p>
</div>
<div class="swb-button col-xs-3">
<p class="swb-button-name">2</p>
</div>
<div class="swb-button col-xs-3">
<p class="swb-button-name">3</p>
</div>
<div class="swb-button col-xs-3">
<p class="swb-button-name">4</p>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
只需将col-xs-3
更改为col-sm-3
即可。如果您希望它们完全穿过屏幕,请删除第二个 div
。最新的v4版本中不再存在 col-xs-*
。
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="swb col-xl-6 col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="row">
<div class="swb-button col-sm-3">
<p class="swb-button-name">1</p>
</div>
<div class="swb-button col-sm-3">
<p class="swb-button-name">2</p>
</div>
<div class="swb-button col-sm-3">
<p class="swb-button-name">3</p>
</div>
<div class="swb-button col-sm-3">
<p class="swb-button-name">4</p>
</div>
</div>
</div>
</div>
&#13;