I'm trying to create overlapping badges using either grid or flexbox, I'm not able to achieve it correctly.
I want something like this
<div class="grid">
<img src="" alt="" class="image">
<img src="" alt="" class="image">
</div>
This is the CSS, it doesn't work
.grid
{
display: grid;
grid-template-columns: repeat(5, 1fr);
width: 80%;
max-width: 600px;
margin: 0 auto;
}
.image
{
grid-row: 1 / 2;
align-self: center;
}
.image:nth-child(odd)
{
grid-column: 1 / 3;
}
.image:nth-child(even)
{
grid-column: 2 / -1;
}
I know this isn't much to go on but I'm really bad at CSS, some advice is appreciated. Thanks