Has anyone come across this game before?
https://i.sstatic.net/hFX9o.png
I am trying to stack each card in a column, here is my fiddle jsfiddle.
In my scenario, I have cards wrapped in div
elements with a maximum height. If a card exceeds this height, it should not collapse or hide, but instead be stacked on top.
This is what currently happens in my code https://i.sstatic.net/tCKNj.png
I want it to look like this, with each card stacked https://i.sstatic.net/4Feyc.png
HTML
<div class="wrapper">
<div class="card card-1">
<h4 class="header-title">
Lorem Ipsum
</h4>
<div class="card-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque iusto molestiae eos totam ea, ratione quis veritatis commodi,
</p>
</div>
</div>
<div class="card card-2">
<h4 class="header-title">
Lorem Ipsum
</h4>
<div class="card-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque iusto molestiae eos totam ea, ratione quis veritatis commodi,
</p>
</div>
</div>
<div class="card card-3">
<h4 class="header-title">
Lorem Ipsum
</h4>
<div class="card-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque iusto molestiae eos totam ea, ratione quis veritatis commodi,
</p>
</div>
</div>
</div>
CSS
.wrapper{
display: flex;
flex-direction: column;
max-height: 75vh;
overflow: hidden;
}
.card{
padding: 0.4em 1rem;
width: 250px;
border-radius: 5px;
margin: 0.5rem;
}
.card.card-1{
background: salmon;
border: 2px solid red;
}
.card.card-2{
background: royalblue;
border: 2px solid blue;
}
.card.card-3{
background: greenyellow;
border: 2px solid limegreen;
}
Any ideas on what I should do to achieve this?