<h2>Grid</h2>
<section class="grid">
  <div class="item">item1</div>
  <div class="item">item2</div>
</section>

<h2>Flexbox</h2>
<section class="flex">
  <div class="item">item1</div>
  <div class="item">item2</div>
</section>

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 100px 100px;
  grid-gap: 20px;
}

.flex {
  display: flex;
  justify-content: space-between;
}

section:before {
  content: "Before Content";
  display: block;
  
  background-color: #7CCBB0;
  border-radius: 5px;
  padding: 10px;
}

section:after {
  content: "After Content";
  display: block;
  grid-column: 2;
  grid-row: 1 / span 2;
  
  background-color: #7CCBB0;
  border-radius: 5px;
  padding: 10px;
}

External CSS

  1. https://codepen.io/matuzo/pen/vmpaWe/

External JavaScript

This Pen doesn't use any external JavaScript resources.