P2.7: Transitions & Keyframes

Animations add premium feedback to user interactions, making interfaces feel active and responsive.


1. Transitions vs. Keyframes

  • Transitions: Interpolate properties smoothly when a state changes (e.g. :hover).
  • Keyframes: Run complex looping animations without user interaction.
/* Smooth Hover Transition */
.btn {
  background-color: blue;
  transition: background-color 0.3s ease;
}
.btn:hover {
  background-color: green;
}
Val Head

Val HeadView Profile 🔗

Real-World Developer Case Study
10 Years Exp
RoleMotion Design Specialist
Salary₹68 Lakhs/yr equivalent
CompanyAdobe
Core Tech Stack
CSS TransitionsAnimationsMotion DesignUI Performance

Micro-animations should be subtle and fast (typically 200ms to 400ms). Always animate transform and opacity properties. Sizing changes cause expensive layout reflows!


🎓 Practice Assignment Tasks

  • Build a card layout in HTML.
  • When hovered, make the card scale up by 3% (`transform: scale(1.03)`) and fade in a glowing box shadow smoothly over 300ms.
Stuck? Hints available
/* Write your CSS styling rules here to complete the assignment */
🔒 Code requirements not met yet. Complete the tasks above.
🔒 Complete the Practice Assignment above to unlock completion.
Advertisement
NS
Ask Nextsem
AI Mode
NS
Home
Course
Playground