![New aspect-ratio CSS property supported in Chromium, Safari Technology Preview, and Firefox Nightly | Articles | web.dev New aspect-ratio CSS property supported in Chromium, Safari Technology Preview, and Firefox Nightly | Articles | web.dev](https://web.dev/static/articles/aspect-ratio/image/object-fit-demo-visualiza-6e1b75de8297c.jpg)
New aspect-ratio CSS property supported in Chromium, Safari Technology Preview, and Firefox Nightly | Articles | web.dev
CSS object-fit:contain; | 🔥 Use CSS object-fit: contain; and object-fit: cover; to scale 100% width and 100% height images as large as they will go without messing up aspect... | By Wes
![Roni Rahman on X: "The CSS object-fit property lets you control how an image or video fits inside its container. The possible values are: fill: The image or video is resized to Roni Rahman on X: "The CSS object-fit property lets you control how an image or video fits inside its container. The possible values are: fill: The image or video is resized to](https://pbs.twimg.com/media/F3T_qcxaoAAhFH8.jpg:large)
Roni Rahman on X: "The CSS object-fit property lets you control how an image or video fits inside its container. The possible values are: fill: The image or video is resized to
![codemarch on X: "🎯 CSS Object-fit Property 👇 It is used to specify how an <img> or <video> should be resized to fit its container. https://t.co/x5uxwPJGaE" / X codemarch on X: "🎯 CSS Object-fit Property 👇 It is used to specify how an <img> or <video> should be resized to fit its container. https://t.co/x5uxwPJGaE" / X](https://pbs.twimg.com/media/FlhaZ3EaYAALsqo.jpg:large)
codemarch on X: "🎯 CSS Object-fit Property 👇 It is used to specify how an <img> or <video> should be resized to fit its container. https://t.co/x5uxwPJGaE" / X
![html - How can I use "object-fit: contain" in CSS and still have a border radius on the image? - Stack Overflow html - How can I use "object-fit: contain" in CSS and still have a border radius on the image? - Stack Overflow](https://i.stack.imgur.com/dX4Kp.gif)