Predict Transition Duration
Predict Output Easy
Question
How long does the background color transition take on hover?
Code
.btn {
background: blue;
transition: background 0.3s ease;
}
.btn:hover {
background: red;
}
Hint
The duration is specified in the transition shorthand.
Explanation
The transition shorthand 'background 0.3s ease' specifies that the background property transitions over 0.3 seconds (300 milliseconds) with an ease timing function. On hover, the background smoothly changes from blue to red over that duration.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.