Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

mix-blend-mode — blending an element with its backdrop

The mix-blend-mode property controls how an element's colors blend with content painted behind it. The result depends on the backdrop; isolation: isolate can limit blending to a group.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required. The Compositing and Blending Level 2 draft includes `plus-darker`, but Chromium 152 does not support that keyword.

Syntax

mix-blend-mode: normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity | plus-lighter;

mix-blend-mode selects how a rendered element blends with its backdrop: content already painted behind it. Unlike background-blend-mode, it is not restricted to the element's own background layers. The initial value is normal: no color blending, although ordinary alpha compositing still applies. The property is not inherited.

multiply multiplies corresponding color channels in the 0–1 range; screen produces a lightening effect. plus-lighter, included in the Level 2 draft, adds alpha-weighted components and clamps the result; it is not a synonym for lighten.

A value other than normal creates a stacking context. Set isolation: isolate on a container to prevent its descendants from blending with content outside the group. The mix-blend-mode property is not animatable.

In the example, opaque cyan multiplied by yellow produces a green square. This is an expected result, not a confirmed test. When blending text, check readability against every possible backdrop.

Examples

<!doctype html>
<meta charset="utf-8">
<title>mix-blend-mode: multiply</title>
<style>
  .stage {
    isolation: isolate;
    width: 160px;
    height: 120px;
    padding: 20px;
    background: #ffff00;
  }
  .patch {
    width: 100px;
    height: 100px;
    background: #00ffff;
    mix-blend-mode: multiply;
  }
</style>
<div class="stage">
  <div class="patch"></div>
</div>

Result

Expected rendering: a green (#00ff00) 100 × 100 px square on a yellow (#ffff00) background. With mix-blend-mode: normal, the square would be cyan (#00ffff).

The example is expected to render a green square. Its color was not confirmed by a test that checked pixel values.

Sources