The code below gives me this layout.
If I want item 3 to occupy the last 2 rows I will add - grid-row: 2 / 4 to .d3 - and I thought that would just extend the yellow to the bottom of the container. Well it does do that but unexpectedly - it also places item 3 to the left and I can’t understand why a property that should only affect the vertical dimension also had this unexpected effect on the horizontal alignment.
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Ranchers&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Things Grid</title>
<style>
.d1 {background: rgb(255, 51, 0);
grid-column: 1 / 4;
}
.d2 {background: rgb(255, 153, 0);}
.d3 {background: rgb(255, 230, 0);
}
.d4 {background: rgb(0, 255, 0);}
.d5 {background: rgb(0, 132, 255);
color: yellow;}
.container {
width: 90%;
background:rgb(163, 163, 156);
padding: 20px 0px 20px 30px;
font-family: "Ranchers";
font-size: 30px;
display: grid;
grid-template-columns: 1fr 100px 2fr;
grid-template-rows: 130px 130px;
grid-gap: 10px 15px;
}
.SA {
padding: 15px;
}
</style>
</head>
<body>
<div class="container">
<div class="d1 SA">1</div>
<div class="d2 SA">2</div>
<div class="d3 SA">3</div>
<div class="d4 SA">4</div>
<div class="d5 SA">5</div>
</div>
</body>
</html>