0

I am using display: flex to create a responsive card-based dashboard.

Fiddle here.

I noticed that the cards (each individual element div) all shrink or expand vertically to maintain the same size when in a row. So, the height of the biggest (or highest) card is inherited by the rest of the cards in the same row.

Note: When you resize the Fiddle window, you will notice this happens only when more than one card is present in a row. So, when the window is too small to allow only one card horizontally, the size is dependent on the content inside.

I can't seem to figure out which property is doing that so here's my question:

How to get the cards to NOT get resized?

OR

How to retain the responsiveness without using display: flex

Asons
  • 84,923
  • 12
  • 110
  • 165
Shreyas Tripathy
  • 325
  • 7
  • 19

1 Answers1

1

If you don't want the cards to be resized, you should had align-items: flex-start on the flex container and remove the min-height: 250px on the cards. Maybe you can set height: auto on the cards

Victor Allegret
  • 2,344
  • 3
  • 18
  • 31