Home / CSS Tips Generated By ChatGPT / 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; }