3 ms·
Believe this is what people are looking for: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit https://developer.mozilla.org/en-US/docs/Web/CSS/objec
by flomo 9y ago
Believe this is what people are looking for:
https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
- bzbarsky 9y agoThis works if you set "width: 100%; height: 100%", yes (and "object-fit: contain").
- tzahola 9y agoNope. See my comment above.
- tzahola 9y agoNope. This determines how the image is rendered within the img element. The img element itself won’t be constrained in its aspect ratio. E.g. try adding a border or drop-shadow to the img and you’ll see the problem.