Currently struggling to construct a layout of colored blocks for an exercise. I have 6 rows of blocks all the same size, but the next div, named violet, should be full width and consist of 4 rows. This is the desired outcome: https://i.sstatic.net/XG7pB.png
This is the current HTML and CSS code. I know it should involve grid template areas, but I can't seem to get it right.
body, html {
height: 100vh;
}
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
.container {
width: 800px;
height: 800px;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(6, 1fr);
gap: 15px;
}
.container div {
border-radius: 20px;
}
.red {
background-color: rgb(199, 48, 48);
}
.lightblue {
background-color: rgb(55, 207, 245);
}
lightgreen {
background-color: greenyellow;
}
.blue {
background-color: rgb(35, 35, 121);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Grid</title>
</head>
<body>
<div class="container">
<!-- Row 1 -->
<div class="red"></div>
<div class="red"></div>
<div class="red"></div>
<div class="red"></div>
<!-- Row 2 -->
<div class="lightgreen"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<!-- Row 3 -->
<div class="lightgreen"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<!-- Row 4 -->
<div class="lightgreen"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<!-- Row 5 -->
<div class="lightgreen"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<div class="lightblue"></div>
<!-- Row 6 -->
<div></div>
<div></div>
<div class="blue"></div>
<div class="blue"></div>
</div>
</body>
</html>
If anyone has a solution on how to achieve this using primarily grid template areas, your input would be greatly appreciated!