Bootstrap 4-嵌套列-在col-11内适合4列

时间:2018-10-16 15:03:34

标签: bootstrap-4

我试图在col-11内装入4列,但这些垂直堆叠。有人可以帮助我纠正/解释此行为吗?这是相同的代码和codepen示例:

https://codepen.io/anon/pen/VEyyOp

<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"/>
</head>

<body>
    <div class="container-fluid no-gutters">

        <div class="row no-gutters">
            <div class="col-1">PHASES</div>
            <div class="col-11 no-gutters">
                <div class="col-3 col-md-3 col-sm-3 col-lg-3">DISCOVER</div>
                <div class="col-3 col-md-3 col-sm-3 col-lg-3">DESIGN</div>
                <div class="col-3 col-md-3 col-sm-3 col-lg-3">DELIVER</div>
                <div class="col-3 col-md-3 col-sm-3 col-lg-3">DEPLOY</div>
            </div>
        </div>
    </div>
</body>

</html>

1 个答案:

答案 0 :(得分:1)

我很确定您在row内只需要一个col-11

<div class="col-11 no-gutters">
  <div class="row">
    <div class="col-3 col-md-3 col-sm-3 col-lg-3">DISCOVER</div>
    <div class="col-3 col-md-3 col-sm-3 col-lg-3">DESIGN</div>
    <div class="col-3 col-md-3 col-sm-3 col-lg-3">DELIVER</div>
    <div class="col-3 col-md-3 col-sm-3 col-lg-3">DEPLOY</div>
  </div>
</div>

https://codepen.io/anon/pen/MPrQVa