HTML Academy
Animating CSS Filters
CSS filters13/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
Challenge: Filter Combinations
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Smooth Transitions and CSS Filters

Now let’s see how we can apply smooth transitions to filters.

For example, you can use filters to make an image black and white and blurred, remove the filter effect upon hover, and make the visual change itself smoother.

By the way, the filter property has a default value of none. Let’s use it to remove the filter effect when hovering the cursor over the image.

The transition property is discussed in detail in the “Smooth Transitions” section.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Smooth Transitions and CSS Filters</title> <link href="course.css" rel="stylesheet"> <link href="style.css" rel="stylesheet"> </head> <body> <div class="compare"> <div class="compare-single combo"> <img src="img/spb-6-full.jpg" alt=""> </div> </div> </body> </html>
CSS
.combo img { } .combo img:hover { }

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. Assign the grayscale(1) filter combination to the image in the .combo block
    2. as well as blur(2px).
    3. Set the filter value to change to none when the cursor is hovered over the image.
    4. Then add a smooth transition for all properties to the image with a duration of 0.6s.

    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.