5

Helo, can anyone help me with this one, i would like to lorem ipsum have same height in every li, but not max-height. When i have 4 line title i would like every titles have 4 lines height

h2 {
  margin-top: 0;
    flex: 1 0 auto
}

here example:

https://codepen.io/anon/pen/qxvJqw

I want to achieve something like this, but not flex: 0 1 100px or something like this I would like to be flexible, when the biggest title have 4 lines, all have 4 lines, when biggest have 2 all have two enter image description here I would be very grateful for help Thanks

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
  • This is not possible. There is NO CSS mechanism for equalising heights between elements that do not share a parent. – Paulie_D Mar 02 '18 at 12:56
  • Paulie_D in answer you gave me the height was hardcoded, no flex answer here, I wrote I don't want to have this hardcoded, but depend on lines – matithedeveloper Mar 02 '18 at 13:04
  • read carefully the other question .. first you need to understang that this is impossible with pure CSS [this is the important part] ... then if you insist there is workaround or JS solution – Temani Afif Mar 02 '18 at 13:10
  • 1
    Wanted to point out it's possible with CSS Grid `display: grid` but it's a bit complex. – Yami Odymel Feb 07 '23 at 02:40

0 Answers0