HTML Academy
transition-timing-function, step 3
Smooth transitions8/29
Back to the list of tasks
  • 1. The transition-duration property
  • 2. Transition duration, step 2
  • 3. The transition-property: which properties can be changed smoothly?
  • 4. The transition-delay property
  • 5. The “form” of the transition, transition-timing-function
  • 6. transition-timing-function, step 2
  • 7. transition-timing-function, step 3
  • 8. transition-timing-function, step 4
  • 9. Paper buttons, step 1
  • 10. Paper buttons, step 2
  • 11. Paper buttons, step 3
  • 12. Checkboxes, step 1
  • 13. Checkboxes, step 2
  • 14. Checkboxes, step 3
  • 15. Radio buttons, step 1
  • 16. Radio buttons, step 2
  • 17. Radio buttons, step 3
  • 18. Toggle switches, step 1
  • 19. Toggle switches, step 2
  • 20. Toggle switches, step 3
  • 21. Toggle switches, step 4
  • 22. The transformer icon, step 1
  • 23. The transformer icon, step 2
  • 24. The transformer icon, step 3
  • 25. The transformer icon, step 4
  • 26. Text input field, step 1
  • 27. Text input field, step 2
  • 28. Text input field, step 3
  • 29. Text input field, step 4
Paper buttons, step 1
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

transition-timing-function, step 4

Another possible transition-timing-function value class is steps.

They allow you to assign the “steps” that the transition will unfold across. The steps syntax is as follows:

transition-timing-function: steps(number_of_steps, direction);

Everything is simple here: number_of_steps is an integer designating the number of steps over which the transition will be performed; and direction can take either the value start or end.

Given a start, the first step is carried out at the same time as the start of the transition, and in the case of end, the last step will be carried out together with the completion of the transition.

By the way, the transition can be described in shorthand notation using the transition property. The transition parameters are simply listed separated by spaces: property, duration, form, and delay:

transition: width 1s ease-in 2s;

In this example, a transition is applied to the width of the element, and it will last for one second following the ease-in form, and there will be a delay of 2 seconds before it starts.

We also converted the description of the transition for the .square square in this task to shorthand form.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>transition-timing-function, step 4</title> <meta charset="utf-8"> <link rel="stylesheet" href="material.css"> <link rel="stylesheet" href="style.css"> </head> <body class="theory-theme"> <button class="fab fab-play" type="button">&#58884;</button> <div class="row"> <span class="square"></span> </div> <div class="row"> <span class="square square-experimental"></span> </div> </body> </html>
CSS
.square { left: 0; transition: all linear 3s; } .square-active { left: 75%; border-radius: 50%; } .square-experimental { background-color: #e74c3c; }

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 transition form steps(5, start) to the .square-experimental square,
    2. and then change it to steps(5, end).

    Click the .fab-play button to start a smooth transition.

    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.