語法
背景大小background-size
Setting the size of the background image.
Overview
Class | Declarations |
---|---|
background-size:<size>,`…` | background-size: <size>/16rem,`…`;
|
bg:auto | background-size: auto;
|
bg:cover | background-size: cover;
|
bg:contain | background-size: contain;
|
Apply conditionally
Apply styles based on different states using selectors and conditional queries.
<div class="background-size:10%|20:hover background-size:10%|20@sm background-size:10%|20@dark background-size:10%|20@print">…</div>