Control Image Aspect Ratio Using CSS

Damon Bauer
InstructorDamon Bauer

Share this video with your friends

Send Tweet

Resize images and videos to fill their parent and maintain their aspect ratio with pure CSS. The new object-fit and object-position properties allow you to scale images and videos, much like you could with background-size and background-position.

~ 4 years ago

I'm missing note about that this feature: 'object-fill' is still not supported by Microsoft's browsers. MS Edge status: In Development.