freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #13 of 50

mix-blend-mode · stacking blend

PrismaVSJank the Janitor
Prisma saysmix-blend-mode blends an element’s colors with what’s beneath it, like Photoshop layer modes.

mix-blend-mode: multiply | screen | overlay | difference determines how an element's pixels combine with layers below. It powers duotones, knockout text, and color interactions. background-blend-mode does the same between an element's own background layers.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleOverlay text on an image with mix-blend-mode:difference for a knockout effect.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.wrap{position:relative;width:260px}.wrap img{width:100%;display:block}.wrap h1{position:absolute;inset:0;display:grid;place-items:center;color:#fff;mix-blend-mode:difference;margin:0}</style></head><body style="background:#06040d;padding:20px"><div class="wrap"><img src="https://via.placeholder.com/260x140" alt=""><h1>BLEND</h1></div></body></html>
▶ Open the interactive comic issue
‹ Backdrop-Filter · Frosted GlassClip-Path · Cropping With Shapes ›