Menu Samaritan's Purse

BACKGROUND-SIZE

The background-size property specifies the size of the background images.

SYNTAX

CSS

background-size: value;

JS

object.style.backgroundSize = "value";

VALUES

<'background-size'> = <bg-size>#
<bg-size> = [ <length-percentage [0,∞]> | auto ]{1,2} | cover | contain
<length-percentage> = [ <length> | <percentage> ]
<length>

Specifies the length using a number followed by a unit of measurement.

<percentage>

Specifies the percentage using a number followed by a percent sign (%).

auto

Automatically specified by the user agent.

cover

Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.

contain

Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area.

INITIAL

auto

EXAMPLES

AUTO

CONTAIN

COVER

LENGTH

PERCENTAGE

JS

World Wide Web Consortium (W3C)