As per title, I have a for-loop which cycles through an array, and creates several div boxes (four per row), each div has it's own unique vertical height. What's happening is that the second, third etc row will start where the tallest div is on the row above it. I want divs on the second, third etc row to be pushed up vertically against the div in the row above it, but that's not happening. The tallest div is blocking out the entire row, and whatever is on the next row sits below that div automatically. I want to do this through flex-box, so I thought the align-content: flex-start; command on the parent container of all the indivial div boxes would do this for me, but it's not working.
HTML:
<div class="pasteContainerAll">
<div class="centreLoadSpinner" v-if="pasteList.length === 0">
<div class="lds-spinner" style="100%;height:100%;margin-auto"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
</div>
</div>
<div class="pasteContainerEach" v-else v-for="paste in pasteList" :key="paste.id">
<div class="pasteTitleContainer"><router-link :to="{ name: 'EditPaste', params: {paste_slug: paste.slug}}"><i class="far fa-edit"></i></router-link>
{{ paste.title }} <i class="far fa-trash-alt" @click="deletePaste(paste.slug)"></i> </div>
<textarea-autosize readonly class="pasteContentTextarea" v-model="paste.content" v-on:click.native="copyContent(paste.content)"></textarea-autosize>
</div>
</div>
CSS:
.pasteContainerAll
{
display: flex;
flex-wrap: wrap;
width: 100%;
align-content: flex-start;
}
.centreLoadSpinner
{
display: flex;
justify-content: center;
width: 100%;
}
.pasteContainerEach
{
width: 24%;
margin-left: 0.5%;
margin-right: 0.5%;
margin-bottom: 1%;
box-sizing: border-box;
}
.pasteTitleContainer
{
margin-bottom: 4px;
display: flex;
width: 100%;
font-size: 1rem;
justify-content: space-between;
}
.pasteContentTextarea
{
font-size: 1rem;
width: 100%;
resize: none;
cursor: pointer;
padding: 0;
box-sizing: border-box;
border: 0;
font-family: 'Roboto', sans-serif;
}