Problem: Staggered Fade-In List Items
Problem description
Given an HTML page containing a list of items:
Write CSS to:
Define a
@keyframes fadeInUpanimation that transitions fromopacity: 0; transform: translateY(20px);toopacity: 1; transform: translateY(0);.Apply
fadeInUpto each<li>with a duration of0.6s, easingease-out, andforwardsfill mode.Use
:nth-child(n)selectors to assign increasinganimation-delay(e.g.,0s,0.2s,0.4s, etc.) to each list item.
Goal
Write CSS rules to animate each <li> item so they fade in and slide up one after another with a consistent delay.
Constraints
Use only CSS (no JavaScript).
List items initial opacity should be
0; transform should betranslateY(20px).Animation name should be
fadeInUp.Animation duration should be
0.6s.Animation timing function should be
ease-out.Animation fill mode should be
forwards.Delay increments should be
0.2sfor each subsequent list item.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Staggered Fade-In List Items
Problem description
Given an HTML page containing a list of items:
Write CSS to:
Define a
@keyframes fadeInUpanimation that transitions fromopacity: 0; transform: translateY(20px);toopacity: 1; transform: translateY(0);.Apply
fadeInUpto each<li>with a duration of0.6s, easingease-out, andforwardsfill mode.Use
:nth-child(n)selectors to assign increasinganimation-delay(e.g.,0s,0.2s,0.4s, etc.) to each list item.
Goal
Write CSS rules to animate each <li> item so they fade in and slide up one after another with a consistent delay.
Constraints
Use only CSS (no JavaScript).
List items initial opacity should be
0; transform should betranslateY(20px).Animation name should be
fadeInUp.Animation duration should be
0.6s.Animation timing function should be
ease-out.Animation fill mode should be
forwards.Delay increments should be
0.2sfor each subsequent list item.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.