Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

CSS Blend Modes | CSS Basics to Advanced lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Basics to Advanced

Lesson 18 of 50

·css

CSS Blend Modes

6 mins

Course progress36%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • `background-blend-mode` mixes multiple background layers.
  • `mix-blend-mode` mixes the element with whatever is behind it.
  • Blend modes are great for creative hero sections but may reduce readability – test contrast.

Blend modes let you mix a layer’s pixels with the pixels behind it, mimicking Photoshop’s blend options. They work on background layers (background-blend-mode) and on individual elements (mix-blend-mode).

Syntax

/* Blend two background images */
.element {
  background-image: url(img1.jpg), url(img2.jpg);
  background-blend-mode: multiply; /* multiplies the colours */
}

/* Blend the element itself with what lies underneath */
.overlay {
  mix-blend-mode: screen;
}

Visual Example – Hero Text Over Image

.hero {
  background: url('mountain.jpg') center/cover;
  color:#fff;
  background-blend-mode: overlay;   /* brightens shadows */
}

Use Cases

  • Creative hero sections – add texture without extra markup.
  • Dynamic color overlays – change theme by swapping blend mode.
  • Data‑visualisation – create UI charts that interact with underlying graphics.

Accessibility Check

Blend modes can drastically affect contrast. Always test your design with tools like WCAG Contrast Checker. If contrast falls below AA thresholds, provide a fallback (e.g., solid colour overlay).

Browser Support

background-blend-mode is supported in Chrome 1+, Safari 6+, Edge 12+, Firefox 30+. mix-blend-mode has similar coverage but may behave slightly differently in Firefox (requires -moz- prefix in older versions).

Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS Basics to AdvancedBrowse activities
Previous lessonCSS FiltersContinue to lesson 19Pseudo‑Classes & Pseudo‑ElementsBack to CSS Basics to Advanced curriculum