Make an image fit a carousel
On this page, the desktop version, some photos don't fit this gallery correctly: https://www.ohvaz.ro/produse/pachetul-de-5-arome-ohvaz/ On mobile I'm happy with it. How can I change it so the photo takes up the entire height? Like it's zoomed in or something like that.
![](https://utfs.io/f/d8cc49fa-b4e1-4d83-9b59-1b78fc772b1c-fhfij0.png)
14 Replies
add
ascpect-ratio: 1/1;
tochecking. thank you
do I need to keep object-fit?
it doesn't seem to help..
![](https://utfs.io/f/7dbd7313-23b8-4e75-a092-09293838022a-scj9d4.27.27.png)
if I remove 100% height, it's even worse
you want cover not scale-down
weirdly i have different css lol to yours
![](https://utfs.io/f/53b4f8af-2f14-4548-9cb9-931466c17f8b-98y2oz.png)
strange..
are all photos looking ok though @mannix_ ?
yup
all occupy the same amount of space as the one in the screenshot
roger
lemme do it live
thank you, it works
I appreciate it
![](https://utfs.io/f/07cc8f80-a14e-4744-b8ea-4b79f0642abf-6byn4.png)
quick q - why is it red?
your editor thinks it's new/unsupported or something like that
roger
thanks again
codepen also highlights it differently but don't worry about it 😉
aspect-ratios is well supported by all browsers for a long time by now