I have a page with an inline-image that is about 4000px wide (good or bad practice, never mind). Is there a CSS way to 'crop' the image so it fits the viewport? Basically like background-size: cover, but for inline images.
As it is a responsive site, I have added this CSS rule for all images:
img { max-width: 100%; height: auto; } Now, for the 'cropped' image, I tried everything with overflow, min- and max-width & -heigh, but I couldn't get it to work, the browser always fits the image to the viewport. Setting a value for min-height even resulted in a squashed image.
overflow: hidden;for the parent element (e.g.div) does not work?