4

I'm using flexbox for a layout. My constraint is that the image must be situated at the middle.

I've made a minimal markup that reproduces the issue: http://codepen.io/anon/pen/xwNomN

It works perfectly well in all browsers EXCEPT on IE 10 and 11, where (as shown in the CodePen) a big amount of empty space is added at the top and bottom of the image.

.collection__list {
  display: flex;
  flex-wrap: wrap;
}

.product-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item__figure {
  position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
}

.product-item__figure > a {
  display: flex;
    position: relative;
    flex: 1;
}

.product-item__image-wrapper {
    position: relative;
    width: 100%;
}

.product-item__image {
      display: block;
    margin: 0 auto;
  max-width: 100%;
}

I've tried a lot of fixes, played with flex-shrink, flex-grow... but after 1 whole day lost, I'd love to know what I'm doing wrong.

Thanks

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Michael Gallego
  • 1,746
  • 1
  • 20
  • 29

1 Answers1

4

Oh... I've found it by chance. Adding overflow: hidden to product-item__figure made the trick....

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Michael Gallego
  • 1,746
  • 1
  • 20
  • 29