πŸ’‘ 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 Text Into Images in CSS

How to Blend Text Into Images in CSS

Ferenc Almasi β€’ 2020 August 19 β€’ πŸ“– 1 min read

You can use the mix-blend-mode property in CSS to blend text into images:

// Use the mix-blend-mode property to blend text
// into images.

.blend { 
  mix-blend-mode: overlay;
}

<figure>
  <img src="nature.jpg" />
  <figcaption class="blend">
    β€œNature does not hurry, 
    yet everything is accomplished.”
~ Lao Tzu
  </figcaption>
</figure>
blend.html
Copied to clipboard!

You can check the result in the following Codepen:

Blending text into images

The mix-blend-mode property can take up a number of different values:

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.css
Copied to clipboard!
How to Blend Text Into Images in CSS
If you would like to see more Webtips, follow @flowforfrank
Looking to improve your skills? Master CSS from start to finish.
Master CSS

Resources:

Did you find this page helpful?
πŸ“š More Webtips
Frontend Course Dashboard
Master the Art of Frontend
  • check Access exclusive interactive lessons
  • check Unlimited access to hundreds of tutorials
  • check Remove ads to learn without distractions
Become a Pro

Courses

Recommended