Bounder Bounder - 7 months ago 10
HTML Question

"Exclude text from blending" CSS-blending

I am making a website for one of our clients. Our designers used blending: multiply because it can be done in CSS these days. I have implemented it in the site but I can't get the requested result and just wanted to ask you people if it even possible.

Here's the case: I have a big header with images in the background. On top of that header floats a round div which has mix-blend-mode: multiply. This works as desired, but in this div there is text which is also blended. Can I keep this text "unblended"?

desired effect:

wanted effect

What it is now:

current situation

Thanks in advance!

Answer

Use a pseduo-element and apply the blend-mode to that instead of the parent div.

div.header {
  width: 100%;
  height: 300px;
  background-image: url(http://www.eikongraphia.com/wordpress/wp-content/BIG_Zira_Island_Copyright_BIG_1_Small.jpg);
}
div.info-bol {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  text-align: center;
  position: relative;
}
div.info-bol::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background-color: red;
  mix-blend-mode: multiply;
}
div.info-bol span {
  position: relative;
  top: 22%;
  font-size: 30px;
  font-weight: bold;
  color: white;
}
<div class="header">
  <div class="info-bol">
    <span>samenwerken<br>is meer dan<br>samen<br>werken</span>
  </div>
</div>