CSS Academy · Lesson

Transition Property Duration and Timing

Define which properties transition, how long they take, and when they start with delay.

Lesson 1 of 413 steps

Transition Property Duration and Timing is a free CSS Academy lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, and your progress syncs across the web and the CoddyKit app. The CSS Academy course includes 4 lessons in total.

What is a CSS Transition?

A CSS transition interpolates between two property values over a specified duration when the value changes (e.g., on hover). No JavaScript is needed.

transition-property

Specifies which CSS properties to animate. Use all to transition every animatable property, or list specific properties.

  <button>Save changes</button>

transition-duration

Sets how long the transition takes. Accepts time values in seconds (s) or milliseconds (ms).

  <div class="card">Card</div>

The transition Shorthand

Combines all four transition sub-properties: property | duration | timing-function | delay.

  <button class="btn">Submit</button>

Multiple Transitions

List multiple transitions separated by commas to independently animate different properties:

  <div class="card">Card</div>

transition-delay

Delays the start of the transition. Useful for sequencing animations or letting one transition finish before another starts.

  <nav>
    <a class="nav-item" href="#">Home</a>
    <a class="nav-item" href="#">About</a>
    <a class="nav-item" href="#">Contact</a>
  </nav>

Transition on the Base State

Always place the transition property on the base state, not the :hover state. This ensures the transition plays on both hover-enter and hover-exit.

  <button class="btn demo-active">Hover me</button>

What Can Be Transitioned?

Most numerical CSS properties can be transitioned: colors, dimensions, opacity, transforms, etc. Discrete properties (like display) cannot be smoothly interpolated — they snap.

transition: all Warning

Using transition: all can cause unexpected animations on properties you do not intend to animate. Always specify explicit properties in production code.

Transitioning Colors

Color transitions interpolate between values. Use the same color format for best results:

  <button class="btn demo-active">Hover me</button>

Transition and Layout Thrash

Avoid transitioning layout-triggering properties like width, height, margin, and padding for performance. They cause layout recalculation on every animation frame. Use transform and opacity instead.

Quick Check

Where should the transition property be placed to ensure it plays on both hover-enter and hover-exit?

Recap

CSS transitions smooth property changes over time using transition-property, duration, timing-function, and delay. Place transitions on the base state for bidirectional animation. Prefer specific property lists over all for performance and predictability.

Free to start

Learn CSS with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
40
Lessons
159

Frequently Asked Questions

Is the “Transition Property Duration and Timing” lesson free?

Yes — the full text of “Transition Property Duration and Timing” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO. The CSS Academy course includes 4 lessons in total.

What will I learn in “Transition Property Duration and Timing”?

Define which properties transition, how long they take, and when they start with delay. You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start CSS Academy?

No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

How long does the “Transition Property Duration and Timing” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this CSS Academy lesson?

Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Transition Property Duration and Timing
  2. Easing Functions: ease linear cubic-bezier
  3. Transitioning Multiple Properties
  4. Performance: Transformable vs Repainting Props
← Back to CSS Academy