1

I'm using flexbox for the first time and some items are at different heights. I'm attempting to get that empty space created by a long image, or possibly a lot of text to get filled in by other items.

Image below shows how I'd like to move the divs: Red arrows show the direction I want filled in

HTML:

<div id="noises">  
<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> Test title</p></strong>
    <p> test</p>
</div>

<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> title</p></strong>
    <a href="#" target="_blank">
        <img src="https://via.placeholder.com/100x150" style="max-width:-webkit-fill-available;max-width:-moz-available">
    </a>
</div>
<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> title</p></strong>
    <a href="#" target="_blank">
        <img src="https://via.placeholder.com/170x130" style="max-width:-webkit-fill-available;max-width:-moz-available">
    </a>
</div>

<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> Lorem ipsum dolor sit amet</p></strong>
    <p> Lorem ipsum</p>
</div>

<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> title</p></strong>
    <a href="#" target="_blank">
        <img src="https://via.placeholder.com/300x648" style="max-width:-webkit-fill-available;max-width:-moz-available">
    </a>
</div>

<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> Test title</p></strong>
    <p> test</p>
</div>

<div class="card text" title=" On a Sunday at 3:24 a.m. ">
    <strong><p> Test title</p></strong>
    <p> test</p>
</div>

CSS:

#noises, .noises{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:center;
    align-items:flex-start;
    height:auto;
    margin:auto;
}
.noise_column{
    flex:30%;
    max-width:30%;
    padding: 0 4px;
}
.noise_column img {
    margin-top: 8px;
    vertical-align: middle;
    max-width:300px;
}
#noises > div, .card{
    min-width: 300px;
    max-width: 300px;
    margin-bottom: 1em;
    padding: 0.5em 0.5em 0.5em 2em;
    margin: 1em;
    border: 2px solid #515151;
    border-radius: 0px 15px 0px 15px;
}
.card, .card > img{
    max-width:300px;
}

Codepen: https://codepen.io/ddefreitas/pen/wvvxgaW

BOMEz
  • 1,020
  • 14
  • 34

1 Answers1

0

This should be enough -:

#noises, .noises{
    display:flex;
    // flex-direction:row;  ------>   **flex-direction:column;**
    **max-height: 1500px;**
    flex-wrap:wrap;
    justify-content:center;
    align-items:flex-start;
    height:auto;
    margin:auto;
}
Abhisar Tripathi
  • 1,569
  • 10
  • 21
  • This surprisingly looks like what I wanted, with one key thing missing: It's no longer responsive – BOMEz Nov 11 '19 at 03:48