0

How can I set same height for rows in list like this:

<div class="container">
  <div class="row"></div>
  <div class="row"></div>
  <div class="row"></div>
</div>

Elements <div class="row"> are dynamic genereted and the amount is not constant.

I look for solution in this style:

.row {
  height: calc(100% / <amount items>)
}

It is possible to get amount items in CSS?

I use flexbox.

ProEvilz
  • 5,310
  • 9
  • 44
  • 74
Jan Kowalski
  • 205
  • 2
  • 7
  • 14
  • Does it have to be a css solution? or can it be js as well – Robbin van der Jagt Oct 05 '16 at 09:04
  • This might help: https://stackoverflow.com/questions/8720931/can-css-detect-the-number-of-children-an-element-has , but you will have to manually add styles for each amount. – Albzi Oct 05 '16 at 09:04
  • you will get same height for rows in the flex-direction as default `align-items` value is `stretch` – kukkuz Oct 05 '16 at 09:07

0 Answers0