Object fit

Syntax

Class
Properties
object-contain
object-fit: contain;
object-cover
object-fit: cover;
object-fill
object-fit: fill;
object-none
object-fit: none;
object-scale-down
object-fit: scale-down;
<img class="t1 w-256 h-256 bg-c-white shadow-4 object-contain" src="/assets/tree.jpg?o1-cache=1">

Specification test cases

The test cases below are imported from the Turbo CSS specification. They have been executed upon loading this page.
Use object-contain
t1 object-contain
.t1.object-contain { object-fit: contain; }
Use object-cover.
t1 object-cover
.t1.object-cover { object-fit: cover; }
Use object-fill.
t1 object-fill
.t1.object-fill { object-fit: fill; }
Use object-none.
t1 object-none
.t1.object-none { object-fit: none; }
Use object-scale-down.
t1 object-scale-down
.t1.object-scale-down { object-fit: scale-down; }