Blend Modes

Discover how to blend the colors of an element with the content beneath it using `mix-blend-mode`.

What are CSS Blend Modes?

CSS blend modes allow you to specify how an element's content should blend with its background. This is a concept borrowed from graphic design software like Photoshop, where you can set layers to blend using modes like "Multiply" or "Screen." In CSS, you can use the `mix-blend-mode` property to achieve these same effects.

The primary use case is to create complex visual effects by blending two or more overlapping elements. It's great for things like creating text that reveals a background image or making interactive hover effects.

The `mix-blend-mode` Property

The `mix-blend-mode` property applies to an element and controls how it blends with the element directly behind it. It's like applying a filter to the element itself and how it interacts with the background.

.overlapping-element {
  mix-blend-mode: multiply;
}

Some common values include `normal`, `multiply`, `screen`, `overlay`, `darken`, `lighten`, and `difference`.

Live Example

In this example, a small red circle with different `mix-blend-mode` values is placed on top of a larger, gradient background. You can see how each blend mode changes the appearance of the circle based on the colors of the background beneath it.

Blend Modes in Action

Normal

Multiply

Screen

Overlay

Darken

Lighten