<h2>Aligning the Whole Grid</h2>

<div class="container">
  <div class="item a">A</div>
  <div class="item b">B</div>
  <div class="item c">C</div>
  <div class="item d">D</div>
  <div class="item e">E</div>
  <div class="item f">F</div>
  <div class="item g">G</div>
  <div class="item h">H</div>
  <div class="item i">I</div>
</div>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 10px auto;
  width: 700px;
  font-family: 'Lato';
  text-align: center;
}

h2 {
  margin: 25px;
  margin-bottom: 50px;
  font-size: 2em;
}

.container {
  display: grid;
  height: 600px;
  grid-template-columns: 150px 150px 150px;
  grid-gap: 10px;
  font-family: 'Lato';
  text-align: center;
  font-size: 1.4em;
  margin: 40px 30px;
  justify-content: space-around;
  background: #dedede;
  align-content: space-evenly;
}

.item {
  padding: 40px;
  font-size: 1.5em;
  border: 1px solid black;
}

.a,
.b,
.c {
  background: orange;
}

.d,
.e,
.f {
  background: violet;
}

.g,
.h,
.i {
  background: lightgreen;
}

.j,
.k,
.l {
  background: cornflowerblue;
}

External CSS

  1. https://fonts.googleapis.com/css?family=Lato

External JavaScript

This Pen doesn't use any external JavaScript resources.