如何在容器流体中使用bootstrap 4容器,如何将文本始终保留在容器中

时间:2019-09-11 12:58:40

标签: javascript html css bootstrap-4

1 个答案:

答案 0 :(得分:0)

就这样:)

https://jsfiddle.net/7pd5xn6h/2/

.container-fluid-bg {
  background-color: blue;
}

.container-bg {
  background-color: green;
  min-height:300px;
}

.row-bg {
  background-color: yellow;
}

.col-bg {
  background-color: red;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid container-fluid-bg">
  <div class="container container-bg">
    <div class="row row-bg">
 
      <div class="col-7 offset-1 col-bg">
        Hello
      </div>
      <div class="col-4 col-bg">Hello</div>
    </div>
  </div>
</div>