background-size

size of the background image

Example

1

Description

size of the background image

The size can be given as a width and height in pixels, or in percentages. With percentages, the size is relative to the box specified by background-origin. If only one value is given, it applies to both width and height.

Values

Value Description
Values
width heightwidth and height dimensions
width% height%relative width and height dimensions
autopreserves the image's original aspect ratio
contain
cover