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 Filters | CSS Basics to Advanced lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Basics to Advanced

Lesson 17 of 50

·css

CSS Filters

7 mins

Course progress34%

What you'll learn

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

3 points
  • `filter` is hardware accelerated in modern browsers.
  • Use `backdrop-filter` for glass‑morphism effects (needs background with transparency).
  • Apply `filter` sparingly – many filters can be CPU intensive on large images.

The filter property applies image‑processing effects directly in the rendering pipeline, similar to Photoshop layers.

Common filter functions

FunctionExampleEffect
blur(px)blur(5px)Softens the image.
brightness(%)brightness(150%)Makes the element brighter.
contrast(%)contrast(200%)Increases contrast.
grayscale(%)grayscale(0.5)50 % grayscale.
hue-rotate(deg)hue-rotate(90deg)Shifts hue wheel.
invert(%)invert(100%)Color inversion (good for dark‑mode hacks).
sepia(%)sepia(0.7)Vintage look.
drop-shadow()drop-shadow(2px 4px 6px black)Like box-shadow but respects transparency.

Example – Hover‑Blur Card Image

.card img {
  transition:filter .3s ease;
}
.card:hover img {
  filter:blur(2px) brightness(0.9);
}

The transition is GPU‑accelerated because filters are applied on the compositor layer in modern browsers.


backdrop-filter – The Glass‑Morphism Trick

.glass {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3);
}

backdrop-filter affects everything behind the element, giving a frosted‑glass appearance.


Performance Warning

Filters on large raster images can be CPU‑intensive. Use them sparingly, limit the area via clip-path, or provide a fallback for low‑power devices.

Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS Basics to AdvancedBrowse activities
Previous lessonCSS Gradients Deep DiveContinue to lesson 18CSS Blend ModesBack to CSS Basics to Advanced curriculum