background-size
The background-size property specifies the size of a background image.
Formal Syntax
<bg-size>#
JavaScript Access
// Access via element.style
element.style.backgroundSize = 'auto';
Browser Support
| Feature | Chrome | Firefox | Safari | Edge |
|---|---|---|---|---|
| background-size | 3 | 4 | 5 | 12 |
| auto | 1 | 3.6 | 3 | 12 |
| contain | 3 | 3.6 | 5 | 12 |
| cover | 3 | 3.6 | 5 | 12 |
Related Properties
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-position-x
- background-position-y
- background-repeat
- background-repeat-x ๐งช
- background-repeat-y ๐งช
- background-position-block ๐ง
- background-position-inline ๐ง
- background-repeat-block ๐ง
- background-repeat-inline ๐ง
- background-tbd ๐ง