swiperjs Slideshow - scale image either to height or width

I am trying to make a slideshow using swiper.js. I want all the image the same height. If the width because to wide for the cell it should use the max-width. What would be the professinal way to make this. Maybe without using javascript. For the mobile view it should use the max-height, so that the image is not breaking the container. https://markrabadan.com/personal-work/
2 Replies
MarkBoots
MarkBoots2y ago
you allready have the image set to 100% width and height of the container. If you set 'object-fit: contain' that will make sure it wont cut-off
pixelcrash
pixelcrash2y ago
swiperjs is scaling the images and overwrites my css. Somehow on mobile I am not able to make it stick to the max height of 100vh - footer - nav The image is always too long https://markrabadan.com/personal-work/