EDIT: Ive changed the wording of my question since my question is not the same as the answer in another question linked to above.
I have a two column, multiple row flex layout, each row has two <div class="flex-grid"> .. </div>
elements.
I want to lose the empty space below the text, I don't want to specify a height as a fixed height will be either too small or big depending on a users browser screen width.
I just want say a padding of 20px below the text, I dont want this huge gap below the text until the div ends and the the next row begins.
How can I do this without setting a fixed height.
P.S. when I run this code in stackexchanges "run code snippet, it actually gives me the result I want! this is not however how it appears if saved as and html file and opened in Chrome.
.col-xs,
.col-sm {
position: relative;
}
.col-sm {
float: left;
}
.col-sm {
width: 91.66667%;
}
.flex-grid-component {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.flex-grid-component .flex-grid {
box-sizing: border-box;
flex: 0 1 auto;
display: flex;
border: 0 solid transparent;
flex-basis: 50%;
max-width: 50%;
border-width: 1.5vw;
}
.property-item-container {
width: 100%;
height: 100%;
background-color: black;
color: white;
position: relative;
}
.property-item-container .property-details {
display: flex;
}
<div class="col-xs col-sm">
<div class="flex-grid-component">
<div class="flex-grid">
<div class="property-item-container">
<div class="property-details">
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a malesuada lorem, ut gravida metus. Cras elementum vitae mi a ornare. Curabitur eget congue diam, at dictum ante.
</div>
</div>
</div>
</div>
<div class="flex-grid">
<div class="property-item-container">
<div class="property-details">
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a malesuada lorem, ut gravida metus. Cras elementum vitae mi a ornare. Curabitur eget congue diam, at dictum ante.
</div>
</div>
</div>
</div>
<div class="flex-grid">
<div class="property-item-container">
<div class="property-details">
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a malesuada lorem, ut gravida metus. Cras elementum vitae mi a ornare. Curabitur eget congue diam, at dictum ante.
</div>
</div>
</div>
</div>
</div>
</div>