CSS 데모: object-fit 데모 버튼을 클릭해 보세요!
selector {
    object-fit: fill | contain | cover | none | scale-down;
}
<img src="flower.jpg" alt="flower">
img {
    width: 300px;
    height: 100px;
    object-fit: cover;
}
실제 적용 모습
<img src="flower.jpg" alt="flower">
img {
    width: 300px;
    height: 100px;
    object-fit: contain;
}
실제 적용 모습
<img src="flower.jpg" alt="flower">
img {
    width: 300px;
    height: 100px;
    object-fit: fill;
}
실제 적용 모습
<img src="flower.jpg" alt="flower">
img {
    width: 300px;
    height: 100px;
    object-fit: scale-down;
}
실제 적용 모습
<img src="flower.jpg" alt="flower">
img {
    width: 300px;
    height: 100px;
    object-fit: none;
}
실제 적용 모습
object-fit 속성에 대한 브라우저 호환성
속성
데스크탑 Chrome
Chrome
데스크탑데스크탑 Edge
Edge
데스크탑 Firefox
Firefox
Safari
Safari
object-fit 32 79 36 10

caniuse.com에서 더 자세한 정보를 확인해 보세요.