Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

26. CSS - Filters

Lesson 26 of 34 in the free CSS Customization: Zero to Hero notes on Siksha Sarovar, written by Rohit Jangra.

CSS Filters

The filter property defines visual effects (like blur and saturation) to an element (often <img>).

Common Filter Functions

  1. blur(px): Applies a blur effect to the image.
  2. filter: blur(5px);

  3. brightness(%): Adjusts the brightness of the image to appear more bright or dark.
  4. filter: brightness(200%);

  5. contrast(%): Adjusts the contrast of the grayscale image.
  6. filter: contrast(200%);

  7. drop-shadow(h-shadow v-shadow blur spread color): Applies a drop shadow effect.
  8. filter: drop-shadow(8px 8px 10px gray);

  9. grayscale(%): Converts the image to grayscale. 100% is completely gray.
  10. filter: grayscale(100%);

  11. hue-rotate(deg): Applies a hue rotation on the image.
  12. filter: hue-rotate(90deg);

  13. invert(%): Inverts the samples in the image.
  14. filter: invert(100%);

  15. opacity(%): Sets the opacity level.
  16. filter: opacity(50%);

  17. saturate(%): Saturates the image.
  18. filter: saturate(8);

  19. sepia(%): Converts the image to sepia (reddish-brown).
  20. filter: sepia(100%);

Example

img {
  filter: grayscale(100%);
  transition: filter 0.5s;
}

img:hover {
  filter: grayscale(0%);
}