Implementing Object-fit for Images and Videos in CSS


Control the sizing of images and videos within their container, preserving aspect ratio.

Source Code

img, video {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments