HTML Academy
Challenge: Using Various Filters
CSS filters10/14
Back to the list of tasks
  • 1. Brightness and Contrast
  • 2. Grayscale and Sepia
  • 3. Invert and Saturate
  • 4. Color Rotation, hue-rotate
  • 5. Blur and Opacity
  • 6. Shadow, drop-shadow
  • 7. The Difference Between box-shadow and drop-shadow
  • 8. Applying CSS Filters to Text
  • 9. Challenge: Using Various Filters
  • 10. Combination of Filters
  • 11. Combining the drop-shadow Filters
  • 12. Animating CSS Filters
  • 13. Smooth Transitions and CSS Filters
  • 14. Challenge: Filter Combinations
Combining the drop-shadow Filters
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Combination of Filters

Several filters can be applied to the same block at the same time. To do this, all filters are simply listed separated by spaces after the word filter:

.effect {
  filter: sepia(50%);
  filter: sepia(50%) blur(5px);
  filter: sepia(50%) blur(5px) opacity(50%);
}

You should keep in mind that if you list the filters in a different order, you will get a different result. This is because each subsequent filter is applied to the image after the effect of the previous filter has already been applied.

Let’s try this out in practice.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Combination of Filters</title> <link href="course.css" rel="stylesheet"> <link href="style.css" rel="stylesheet"> </head> <body> <div class="image"> <img src="img/spb-6.jpg" alt=""> </div> <div class="compare"> <div class="compare-left multi-filter-1"> <div class="image"> <img src="img/spb-6.jpg" alt=""> </div> </div> <div class="compare-right multi-filter-2"> <div class="image"> <img src="img/spb-6.jpg" alt=""> </div> </div> </div> </body> </html>
CSS
.multi-filter-1 img { } .multi-filter-2 img { }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Apply the filter hue-rotate (90deg) to the image in the .multi-filter-1 block,
    2. then add the second filter saturate(2),
    3. and finally apply the third filter sepia (0.8).
    4. Apply a combination of three filters in the following order to the image in the .multi-filter-2 block: sepia(0.8),hue-rotate(90deg), and saturate(2).

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.