/* Keywords syntax */
mask-size: cover;
mask-size: contain;
/* One-value syntax */
/* the width of the image (height set to 'auto') */
mask-size: 50%;
mask-size: 3em;
mask-size: 12px;
mask-size: auto;
/* Two-value syntax */
/* first value: width of the image, second value: height */
mask-size: 50% auto;
mask-size: 3em 25%;
mask-size: auto 6px;
mask-size: auto auto;
/* Multiple values */
/* Do not confuse this with mask-size: auto auto */
mask-size: auto, auto;
mask-size: 50%, 25%, 25%;
mask-size: 6px, auto, contain;
/* Global values */
mask-size: inherit;
mask-size: initial;
mask-size: revert;
mask-size: revert-layer;
mask-size: unset;
One or more <bg-size>
values, separated by commas.
A <bg-size>
can be specified in one of three ways:
- using the keyword
contain
- using the keyword
cover
- using width and height values
To specify a size using width and height, you can supply one or two values:
- If only one value is given it sets the width, with the height set to
auto
. - If two values are given, the first sets width and the second sets height.
Each value can be a <length>
, a <percentage>
, or auto
.