<h2>Grid Auto-placement Algorithm Step 5 - Dense</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 f">I</div>
</div>
* {
margin: 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;
grid-template-columns: 150px 150px 150px 150px;
grid-gap: 10px;
grid-auto-flow: row dense;
font-family: 'Lato';
text-align: center;
font-size: 1.4em;
margin: 40px 30px;
}

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

.b {
background: violet;
grid-area: 2 / 1 / 4 / 3;
}

.a {
background: violet;
grid-area: 1 / 2 / 2 / 3;
}

.c {
background: orange;
grid-row-start: 1;
grid-row-end: 3;
}

.d {
background: orange;
grid-row-start: 1;
grid-row-end: 2;
}

.g {
background: lightgreen;
grid-column-start: 3;
grid-column-end: 5;
}

.h {
background: lightgreen;
grid-column-start: 2;
grid-column-end: 4;
}

### External JavaScript

This Pen doesn't use any external JavaScript resources.