Looking for a way to make these cards start a new row every two 'article' regions in HTML / CSS.
.tiles_bodyLOB {
display: flex;
grid-template-columns: auto auto;
column-gap: 1rem;
row-gap: 1rem;
margin-top: 0.25rem;
@media (max-width: 700px) {
grid-template-columns: repeat(1, 1fr);
}
padding: 1rem;
border-radius: 8px;
justify-content: space-between;
}
.tilesLOB {
display: grid;
grid-template-columns: auto auto;
gap: 1rem;
@media (max-width: 700px) {
grid-template-columns: repeat(1, 1fr);
}
}
.tile-styleLOB {
background-color: red;
min-height: 200px;
transition: 0.25s ease;
&:hover {
transform: translateY(-5px);
}
&:focus-within {
box-shadow: 0 0 0 2px var(--c-gray-800), 0 0 0 4px var(--c-olive-500);
}
min-width: 600px;
}
.a-tag:link {
color: white;
}
.a-tag:hover {
color: white;
}
.a-tag:visited {
color: white;
}
<div id="tile-container">
<div class="tiles_bodyLOB">
<article class="tile-styleLOB">
<h1 style="color: white; font-size: 38px;">
<span> Some Text ABC</span>
</h1>
<span style="color: white; font-size: 24px">
Sub Text 1
</span>
<a href="#">
<div style="color: white; font-size: 18px; grid-template-columns: 1fr 1fr 1fr">
<span> Case A: 1
00</span>
</div>
</a>
</article>
<article class="tile-styleLOB">
<h1 style="color: white; font-size: 38px;">
<span> Some Text ABC</span>
</h1>
<span style="color: white; font-size: 24px">
Sub Text 1
</span>
<a href="#">
<div style="color: white; font-size: 18px; grid-template-columns: 1fr 1fr 1fr">
<span> Case A: 1
00</span>
</div>
</a>
</article>
<article class="tile-styleLOB">
<h1 style="color: white; font-size: 38px;">
<span> Some Text ABC</span>
</h1>
<span style="color: white; font-size: 24px">
Sub Text 1
</span>
<a href="#">
<div style="color: white; font-size: 18px; grid-template-columns: 1fr 1fr 1fr">
<span> Case A: 1
00</span>
</div>
</a>
</article>
The current setup shows all articles/cards in a single row. Any suggestions on how to create a new row after every two cards? (The number of articles will increase soon)
Appreciate any help!