background-size: cover;
background-size: cover;
The CSS background-size
property is used to specify the size of the background image. When given the value cover
, like background-size:cover
, the image covers the complete background of the container in which it is being displayed.
The proportions of the image are maintained, so if the dimensions exceed the container’s, then some parts of the image will be left out.
Join the conversation