Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1312

How to flex items with different height without gaps [duplicate]

$
0
0

I'm trying to create reminders / notes, and I'm having trouble setting the items inside the flex container to ignore height differences in the rows. I want them to fit the space without any gaps (expect the column / row - gap I set).enter image description here

I also tried using display: grid, but I wasn't able to achieve the results I wanted. Here is the code I have now:

.container{    display: flex;    flex-wrap: wrap;    column-gap: 15px;}.item{    position: relative;    padding: 12px;    border-bottom: 1px solid #f0f0f0;    background-color: #fafafa;    border-radius: 4px;    margin-bottom: 10px;    transition: background 0.3s ease;    min-height: 133px;    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.33);    height: fit-content;    width: 46.1%;}

Thanks


Viewing all articles
Browse latest Browse all 1312

Trending Articles