語法
物件適應object-fit
Setting how the content should be resized to fit its container.
Overview
Class | Declarations |
---|---|
object-fit:value | object-fit: value;
|
object-fit:none | object-fit: none;
|
obj:contain | object-fit: contain;
|
obj:cover | object-fit: cover;
|
obj:fill | object-fit: fill;
|
obj:scale-down | object-fit: scale-down;
|
Conditionally apply
Apply styles based on different states using selectors and applying conditionally.
<div class="object-fit:fill:hover object-fit:fill@sm object-fit:fill@dark object-fit:fill@print">…</div>