`background-blend-mode` CSS property
The background-blend-mode CSS property sets how an element's background images should blend with each other and with the element's background color.
The background-blend-mode CSS property sets how an element's background images should blend with each other and with the element's background color.
Blending modes should be defined in the same order as the background-image property. If the blending modes' and background images' list lengths are not equal, it will be repeated and/or truncated until lengths match.
CSS Demo: background-blend-mode
```css interactive-example-choice background-blend-mode: normal;
```css interactive-example-choice
background-blend-mode: multiply;
```css interactive-example-choice background-blend-mode: hard-light;
```css interactive-example-choice
background-blend-mode: difference;
```html interactive-example
```css interactive-example
#example-element {
background-color: green;
background-image: url("/shared-assets/images/examples/balloon.jpg");
width: 250px;
height: 305px;
}
Syntax
/* One value */
background-blend-mode: normal;
/* Two values, one per background */
background-blend-mode: darken, luminosity;
/* Global values */
background-blend-mode: inherit;
background-blend-mode: initial;
background-blend-mode: revert;
background-blend-mode: revert-layer;
background-blend-mode: unset;
Values
- <blend-mode>
- : The blending mode to be applied. There can be several values, separated by commas.
Formal definition
Formal syntax
Examples
Basic example
.item {
width: 300px;
height: 300px;
background: url("image1.png"), url("image2.png");
background-blend-mode: screen;
}
Try out different blend modes
```html hidden
```css hidden
#div {
width: 300px;
height: 300px;
background: url("br.png"), url("tr.png");
background-blend-mode: screen;
}
js hidden
document.getElementById("select").onchange = (event) => {
document.getElementById("div").style.backgroundBlendMode =
document.getElementById("select").selectedOptions[0].innerHTML;
};
console.log(document.getElementById("div"));
330
Specifications
Browser compatibility
See also
- <blend-mode>
- mix-blend-mode