Im building something similar to this
so i want to make that (chess) efect where the last element of the grid-row contains the same background color of the first element background color of the second row
I build my container using grid and placed some cards inside of it, is there any way i can do this using css?
.cards-container {
display: grid;
grid-template-columns: repeat(2, 10rem);
}
.card {
border: 1px solid black;
}
.cards-container > a:nth-child(odd) {
background-color: #4268af;
}
<div class="cards-container">
<a class="card">
<h4 class="card-name">name</h4>
</a>
<a class="card">
<h4 class="card-name">name</h4>
</a>
<a class="card">
<h4 class="card-name">name</h4>
</a>
<a class="card">
<h4 class="card-name">name</h4>
</a>
<a class="card">
<h4 class="card-name">name</h4>
</a>
<a class="card">
<h4 class="card-name">name</h4>
</a>
</div>