background-size - CSS | css background cover
Thebackground-sizeCSS[1]propertysetsthesizeoftheelementsbackgroundimage.Theimagecanbelefttoitsnaturalsize,stretched,orconstrainedtofittheavailablespace.Spacesnotcoveredbyabackgroundimagearefilledwiththebackground-color[2]property,andthebackgroundcolorwillbevisiblebehindbackgroundimagesthathavetransparency/translucency.background-size:cover;background-size:contain;background-size:50%;background-size:3.2em;background-size:12px;background-size:auto;background-size:50%auto;background-size:3em25%...
The background-size CSS[1] property sets the size of the elements background image. The image can be left to its natural size, stretched, or constrained to fit the available space.
Spaces not covered by a background image are filled with the background-color[2] property, and the background color will be visible behind background images that have transparency/translucency.
background-size: cover; background-size: contain; background-size: 50%; background-size: 3.2em; background-size: 12px; background-size: auto; background-size: 50% auto; background-size: 3em 25%; background-size: auto 6px; background-size: auto auto; background-size: auto, auto; background-size: 50%, 25%, 25%; background-size: 6px, auto, contain; background-size: inherit; background-size: initial; background-size: revert; background-size: revert-layer; background-size: unset;The background-size property is specified in one of the following ways:
Using the keyword values contain o...