<div class="grid">
<div class="box item1">A</div>
<div class="box item2">B</div>
<div class="box item3">C</div>
<div class="box item4">D</div>
</div>
body {
margin: 20px;
}
.grid {
display: grid;
grid-gap:20px;
/* grid-template-columns: 1fr 1fr 1fr 1fr; */
/* grid-template-rows: 100px 100px 100px 100px; */
/* Short record (rows / column) */
grid-template: 100px 100px 100px 100px/ 1fr 1fr 1fr 1fr;
grid-template-areas:
"a a a b"
"a a a b"
"c d d d";
}
.item1 {grid-area: a;}
.item2 {grid-area: b;}
.item3 {grid-area: c;}
.item4 {grid-area: d;}
.box {
background-color: #444;
color: #fff;
border-radius: 5px;
padding: 20px;
font-size: 150%;
}
.item1 {
background: #f00;
}
.item2 {
background: #f0f;
}
.item3 {
background: #008000;
}
.item4 {
background: #000;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.