Clean β’ Professional
mix-blend-modeCSS Blend Modes let you control how an elementβs content blends with the background or other elements. Think of it like Photoshop blending layers β you can create creative visual effects without editing images externally.
mix-blend-mode is the main property used to blend an element with the background.
selector {
mix-blend-mode: blend-mode;
}
Common blend modes:
normal β default, no blendingmultiply β multiplies the colors, darkening the resultscreen β lightens the resultoverlay β mix of multiply and screen, preserves highlights & shadowsdarken β keeps the darker colorlighten β keeps the lighter colorcolor-dodge / color-burn β brightens or darkens based on base colorsdifference β subtracts colors, creating contrastexclusion β similar to difference but softerhue / saturation / color / luminosity β affects color propertiesIn this example, the image colors multiply with the yellow background, creating a darker effect.
<div class="background"></div>
<img src="image.jpg" alt="Blend Mode Example" class="blend-img">
.background {
width: 500px;
height: 300px;
background: yellow;
position: absolute;
}
.blend-img {
width: 500px;
mix-blend-mode: multiply;
position: relative;
}
The text blends with the image, creating a dynamic overlay effect.
<div class="container">
<img src="image.jpg" alt="Blend Example">
<h2 class="blend-text">Hello World</h2>
</div>
.container {
position: relative;
width: 400px;
}
.container img {
width: 100%;
}
.blend-text {
position: absolute;
top: 50px;
left: 50px;
font-size: 2rem;
color: white;
mix-blend-mode: screen; /* Blends text with the image */
}
<div class="box red"></div>
<div class="box blue"></div>.box {
width: 200px;
height: 200px;
display: inline-block;
}
.red {
background: red;
}
.blue {
background: blue;
mix-blend-mode: screen;
}Β