I need to create the grid items shown as in the image attached. First Item need to be of 45% and second and third Item need to be 52.5%, and rest items need to be of 50% each. I can not change the HTML as all the grid child coming from a Loop. So I am not able to achieve it by the CSS written, check snippet, By my css its only possible to have the width of left side all items 50%, or 45%, but how to change the width of items from 4 to rest of the items.
Is it possible without changing the HTML?
.atul {
display: grid;
grid-template-columns: 45% 52.5%;
grid-template-rows: auto;
grid-gap: 2.5%;
grid-template-areas: "card1 card2"
"card1 card3";
}
.card:nth-child(1) {
grid-area: card1;
}
.card:nth-child(2) {
grid-area: card2;
}
.card:nth-child(3) {
grid-area: card3;
}
<div class="atul">
<div class="card" style="background-color: red;">Card 1</div>
<div class="card" style="background-color: green;">Card 2</div>
<div class="card" style="background-color: yellow;">Card 3</div>
<div class="card" style="background-color: skyblue;">Card 4</div>
<div class="card" style="background-color: skyblue;">Card 5</div>
<div class="card" style="background-color: skyblue;">Card 6</div>
<div class="card" style="background-color: skyblue;">Card 7</div>
<div class="card" style="background-color: skyblue;">Card 8</div>
<div class="card" style="background-color: skyblue;">Card 9</div>
<div class="card" style="background-color: skyblue;">Card 10</div>
<div class="card" style="background-color: skyblue;">Card 11</div>
<div class="card" style="background-color: skyblue;">Card 12</div>
<div class="card" style="background-color: skyblue;">Card 13</div>
</div>