-1

How to perform the following grid using Bootstrap 4?

I want one column to be from the edge of the window to the inside and the other one as half as standard .container?

bootstrap 4 grid

TylerH
  • 20,799
  • 66
  • 75
  • 101
wolekpl
  • 101
  • 2
  • 10

1 Answers1

1

You should use fluid-container, not container because two of your columns exceeds the container. But column can not do so in Bootstrap.

If fluid-container is too big, restrict its width with custom CSS.

.row div {
  border: 1px solid #000;
}

.h-200px {
  height: 200px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.css" rel="stylesheet" />
<div class="container-fluid">
  <div class="row">
    <div class="col-6 mx-auto p-4 bg-dark">
    </div>
  </div>
  <div class="row">
    <div class="col-6 bg-success h-200px  ">

    </div>
    <div class="col-3 offset-3 mr-auto ml-0 bg-primary h-200px  ">

    </div>
  </div>
  <div class="row">
    <div class="col-6 mx-auto p-4 bg-dark">
    </div>
  </div>
  <div class="row">
    <div class="col-3 offset-3 ml-auto mr-0 bg-success h-200px  ">

    </div>
    <div class="col-6 bg-primary h-200px  ">

    </div>
  </div>
  <div class="row">
    <div class="col-6 mx-auto p-4 bg-dark">

    </div>
  </div>
</div>
enter image description here

Check CodePen

mahan
  • 12,366
  • 5
  • 48
  • 83
  • That could be but this layout is not equal to a regular container [link](https://codepen.io/anon/pen/NMXrom) – wolekpl May 08 '18 at 09:20
  • @user2865895 The container in the img is not equal to the container in the link neither. You need to add more info too. – mahan May 08 '18 at 10:15