The background-size property specifies the size of the background image. Accepts a keyword (auto, cover, contain), one or two <length-percentage> values (horizontal and vertical), or per-layer values separated by commas..hero {
background-size: cover;
}.icon {
background-image: url('icon.svg');
background-size: 32px 32px;
}min:0max:9999step:1units:% | px | em | rem | vw | vh | vmin | vmax | ptautoUses the image's intrinsic size. When only one value is given, the other axis is calculated to preserve the aspect ratio.coverScales the image to the smallest size that covers the entire positioning area (may crop).containScales the image to the largest size that fits inside the positioning area (no cropping).CSS Backgrounds Module Level 4First Public Working Draft<length-percentage>W3CMDNCSSShow all codeEdit CSS onlineThe plugin that remembers hundreds of CSS items for youEvery CSS property — in a live demonstrationThe bilingual CSS referencedefinitionexamplessyntaxmodulespecificationvalue typessourcesvisual demonstrationpreviousnext