Say i've image 400x200 pixels. I want it to zoomin to fit any div until there is no space vertically or horizontally. So in programming i'd say it like this..
if (imgHeight < divHeight || imgWidth < divWidth) {
zoomIt until true and center it vertically and horizontally.
So for example take 400 width image and 100 height. Now i want this image to increase in height until its height is also 200. but since it gotta keep ratios. Its width is going to be 800. And now it needs to center horizontally. since div is just showing 0 - 400 and rest 400 are hidden. Need to show 200 to 600..
The question linked as duplicate doesn't solve it only css way.