I'm trying to implement a react-slick carousel but I'm having trouble getting the image to vertically center. This problem is demonstrated here.
https://codesandbox.io/s/react-slick-playground-o7dhn
Here is the problems
Images are not centered:
- Flexbox property does not work (the red div is a flexbox with
justify-content: center; align-items: center;
) margin:auto
only works for horizontal alignment (which I shouldn't have to set if I'm using flexbox)- I can not get rid of the top margin (even with
padding:0px
on the div andmargin-top:0px
on the image) As a consequence, any image with the height of 400px or more gets shifted and cut off (div has the height of 400px)
How do I fix it.