网页设计引导程序4个可调整大小的列

时间:2019-03-21 08:55:00

标签: html bootstrap-4 navbar web-deployment

建立一个主要针对移动设备的网站。在桌面浏览器上尝试使类别菜单(圆形照片)居中,然后在移动设备上查看时将其调整大小并堆叠为2行,每行3张。有人可以帮助我使用正确的bootstrap4命令来完成这项工作吗?

https://i.imgur.com/iAB4Pic.jpg

https://i.imgur.com/kZkvNTE.jpg

2 个答案:

答案 0 :(得分:2)

使用以下代码:

<div class="container">
  <div class="row">
    <div class="col-6 col-sm-2">One</div>
    <div class="col-6 col-sm-2">Two</div>
    <div class="col-6 col-sm-2">Three</div>
    <div class="col-6 col-sm-2">Four</div>
    <div class="col-6 col-sm-2">Five</div>
    <div class="col-6 col-sm-2">Six</div>
  </div>
</div>

答案 1 :(得分:0)

 <div class="container">
   <div class="row">
    <div class="col-6 col-sm-2">One</div>
    <div class="col-6 col-sm-2">Two</div>
    <div class="col-6 col-sm-2">Three</div>
    <div class="col-6 col-sm-2">Four</div>
    <div class="col-6 col-sm-2">Five</div>
    <div class="col-6 col-sm-2">Six</div>
   </div>
 </div>

感谢Farhan Erooth的回答!