πŸ’‘ This page contain affiliate links. By making a purchase through them, we may earn a commission at no extra cost to you.
How to Blend Elements Together in CSS

How to Blend Elements Together in CSS

Ferenc Almasi β€’ 2020 September 28 β€’ Read time 1 min read
  • twitter
  • facebook
CSS

Did you know that you can use pure CSS to blend images together with the mix-blend-mode property in the following way?

Copied to clipboard! Playground
<style>
    .isolate {
        isolation: isolate;
    }

    .circle {
        mix-blend-mode: screen;
    }
</style>

<div class="isolate">
  <div class="circle r"></div>
  <div class="circle g"></div>
  <div class="circle b"></div>
</div>
blend.html

Note, that it's important to set the parent's isolation to isolate if you don't want to blend with the background. The possible values for mix-blend-mode are:

Copied to clipboard! Playground
mix-blend-mode: normal;
mix-blend-mode: multiply;
mix-blend-mode: screen;
mix-blend-mode: overlay;
mix-blend-mode: darken;
mix-blend-mode: lighten;
mix-blend-mode: color-dodge;
mix-blend-mode: color-burn;
mix-blend-mode: hard-light;
mix-blend-mode: soft-light;
mix-blend-mode: difference;
mix-blend-mode: exclusion;
mix-blend-mode: hue;
mix-blend-mode: saturation;
mix-blend-mode: color;
mix-blend-mode: luminosity;
blend-modes.css
How to Blend Elements Together in CSS
If you would like to see more Webtips, follow @flowforfrank

10 Best Practices for Quickly Improving Your CSS

Resources:

  • twitter
  • facebook
CSS
Did you find this page helpful?
πŸ“š More Webtips
Mentoring

Rocket Launch Your Career

Speed up your learning progress with our mentorship program. Join as a mentee to unlock the full potential of Webtips and get a personalized learning experience by experts to master the following frontend technologies:

Courses

Recommended

This site uses cookies We use cookies to understand visitors and create a better experience for you. By clicking on "Accept", you accept its use. To find out more, please see our privacy policy.