How can I center an image that is larger than its parent element? I have set the min-width and min-height to 100% so that the picture will always fill up the parent element.
The issue arises when the image does not match the proportions of the parent element, causing it to be cropped too much on the right or bottom side.
To solve this problem, I need to find a way to center the oversized image without altering the parent element itself. Is there a CSS solution for this, rather than relying on JavaScript due to potential performance issues when handling numerous images within the DOM?
Attached is a screenshot showing two images contained in a parent . The image sizes are correct, but I am struggling to center them properly.