(Edit) Check out the codepen example here.
I am working on creating a stack of cards using Vue.js and flexbox to showcase different apps on my website. Each card is represented by a component and I utilize Vue's `for` function to display cards with the following HTML template:
<div class="card">
<img src="">
<h1>Title</h1>
<a>Click</a>
</div>
This specific component is named "app-card". The cards are rendered within the following structure in the HTML:
<div id="app">
<div class="row">
<div id="card-container">
<app-card> <!--The above HTML snippet from the template goes here--> </app-card>
</div>
<div id="main"></div>
</div>
</div>
In order to style my card deck, I use the following SASS (CSS without curly braces in this case):
*
margin: 0
padding: 0
font-family: 'Montserrat', sans-serif !important
box-sizing: border-box
.row
display: flex
flex-wrap: wrap
justify-content: space-evenly
align-items: auto
#card-container
flex: 10%
#main
flex: 90%
.card
width: 100%
margin-top: 0;
margin-bottom: auto;
.card img
width: 100%
max-width: 100%
.card a
padding: 10px
background: blue
However, the top of the next card in the deck overlaps with the bottom of the button of the preceding card, as shown in this image:
https://i.sstatic.net/nR80H.jpg
How can I address this issue? I'm transitioning from Bootstrap-4 to learning flexbox concepts recently.