Problem: Slide-In Sidebar Panel
Problem description
Given an HTML page containing a <div class="sidebar-panel"> element, write CSS to:
Position the panel off-screen with
transform: translateX(-100%).Define a
@keyframes slideInanimation that transitionstransformfromtranslateX(-100%)totranslateX(0).Apply the
slideInanimation to the panel with a duration of0.5s, easing functionease-out, and forwards fill mode to retain its final position.
Goal
Write CSS rules to animate the sidebar panel so it slides into view from the left when the page loads.
Constraints
Use only CSS (no JavaScript).
Sidebar width should be
250px.Sidebar height should be
100%.Position should be
fixedattop: 0; left: 0;.Initial transform should be
translateX(-100%).Animation duration should be
0.5s.Animation timing should be
ease-out.Animation fill mode should be
forwards.Name the keyframes
slideIn.
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: Slide-In Sidebar Panel
Problem description
Given an HTML page containing a <div class="sidebar-panel"> element, write CSS to:
Position the panel off-screen with
transform: translateX(-100%).Define a
@keyframes slideInanimation that transitionstransformfromtranslateX(-100%)totranslateX(0).Apply the
slideInanimation to the panel with a duration of0.5s, easing functionease-out, and forwards fill mode to retain its final position.
Goal
Write CSS rules to animate the sidebar panel so it slides into view from the left when the page loads.
Constraints
Use only CSS (no JavaScript).
Sidebar width should be
250px.Sidebar height should be
100%.Position should be
fixedattop: 0; left: 0;.Initial transform should be
translateX(-100%).Animation duration should be
0.5s.Animation timing should be
ease-out.Animation fill mode should be
forwards.Name the keyframes
slideIn.
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.