Short version . Make the image suitable for the visible area for small windows, starting with this fiddle p>
Update . There seems to be no solution to this problem. I thought there could be one thing because Chrome really makes this possible (see My answer), but the behavior in other browsers is different.
Longer version :
I am working on a light light lightbox and have, apparently, a simple CSS problem that I cannot solve.
I want the content (one image) to be reduced, if necessary, to fit, while maintaining the aspect ratio.
Here is a demo script: http://jsfiddle.net/3a9y9/2/ . Resize the window so that the image does not fit the height.
It almost works, but the height indicated on the image is slightly larger than what is actually visible, so the bit of the lower part is cropped. I tried setting things up to no avail; I would like to understand why the available height is too high.
This may be related, but IE 9 doesn't even support aspect ratio with this attempted solution. In addition, Chrome behaves strangely when you resize the window and clicking on run in the violin will sometimes redraw differently.
What's the solution?
There is no need to wrap the <img> in a <div> or two if necessary, but the top-level structure should ideally remain unchanged (i.e. .featherlight-content inside a .featherlight and what it is).
source share