Categories
Mastering Development

Force image aspect ratio also on mobile with CSS (object fit:cover not working)

Background: I have a circle thumbnail img (.x-card-img) that crops also rectangular images on desktop. Problem: However, on lower screen resolutions the thumbnail (right image below) shape morphs into an egg. The problem seems to be that the underlying picture is not square, but that’s exactly the problem I want to resolve, so that regardless […]