CSS transition-property Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Animation & Motion

What You’ll Learn

The transition-property property chooses which CSS properties animate when values change — so you can smooth a color fade without accidentally animating everything.

01

Target props

Pick what animates.

02

all

Default keyword.

03

none

Disable transitions.

04

Lists

Comma-separated.

05

Performance

Prefer transform.

06

Pair with duration

Needs timing too.

Introduction

The transition-property property in CSS is used to specify the CSS properties to which a transition effect should be applied when their values change. This allows for smooth animations and transitions, enhancing the user experience by providing visual feedback during interactions such as hovering, focusing, or clicking elements.

Definition and Usage

Always pair transition-property with transition-duration (or use the transition shorthand). Properties not listed in transition-property will change instantly even if other properties animate smoothly.

💡
Beginner Tip

Instead of all, list only the properties you want to animate — commonly transform, opacity, background-color, and box-shadow.

📝 Syntax

The syntax for the transition-property property is as follows:

syntax.css
element {
  transition-property: property;
}

Here, property can be a specific CSS property name, all, or none.

Basic Example

transition-property.css
.box {
  transition-property: width, background-color;
  transition-duration: 2s;
}

.box:hover {
  width: 200px;
  background-color: red;
}

Syntax Rules

  • Accepts none, all, or one or more property names.
  • Separate multiple properties with commas.
  • Default is all when using transition longhands individually.
  • Must be paired with a positive transition-duration to see animation.
  • The property is not inherited.

Related Properties

  • transition — shorthand for all transition longhands
  • transition-duration — how long listed properties animate
  • transition-delay — wait before animation starts
  • transition-timing-function — speed curve during animation

🎯 Default Value

The default value of the transition-property is all, which means that the transition effect will apply to all the properties that change.

⚡ Quick Reference

QuestionAnswer
Default valueall
Disable transitionstransition-property: none;
Two propertiestransition-property: width, opacity;
Hover lift (recommended)transition-property: transform;
In shorthandtransition: opacity 0.3s ease;
InheritedNo

💎 Property Values

The transition-property property accepts keywords and CSS property names.

ValueExampleDescription
nonetransition-property: none;No properties will transition.
alltransition-property: all;All animatable properties that change will transition.
property namewidth, background-colorOne or more comma-separated CSS property names, such as width, height, background-color, transform, or opacity.
none all transform opacity background-color

When to Use transition-property

Choose properties intentionally based on the effect you want:

  • Hover lifts — Animate transform and box-shadow, not layout properties.
  • Fades and reveals — Use opacity for panels, modals, and tooltips.
  • Color feedback — Transition background-color, color, or border-color on buttons.
  • Disable animation — Set none when you need instant state changes.

👀 Live Preview

Hover the box — only width and background-color animate (height stays fixed):

transition-property: width, background-color

Properties not listed would change instantly.

Examples Gallery

In this example, we’ll create a transition effect for the width and background-color properties of a div element.

📜 Core Patterns

List the exact properties you want to animate instead of relying on all.

Example 1 — Width and background-color

In this example, we’ll create a transition effect for the width and background-color properties of a div element.

index.html
<style>
  .box {
    width: 100px;
    height: 100px;
    background-color: blue;
    transition-property: width, background-color;
    transition-duration: 2s;
  }
  .box:hover {
    width: 200px;
    background-color: red;
  }
</style>

<div class="box"></div>
Try It Yourself

How It Works

Only width and background-color are in the transition list. If you also changed height on hover, it would snap instantly.

Example 2 — Transform only

Limit transitions to transform so background and border changes stay instant while scale animates smoothly.

transform-only.css
.card {
  transition-property: transform;
  transition-duration: 0.35s;
}

.card:hover {
  transform: scale(1.08);
  background: #dbeafe;
}
Try It Yourself

How It Works

Targeting transform alone is a common performance-friendly pattern for hover effects.

📄 UI Patterns

Use opacity fades and multi-property lists for panels and cards.

Example 3 — Opacity fade panel

Reveal a details panel with a smooth opacity transition only.

opacity.css
.panel {
  opacity: 0;
  transition-property: opacity;
  transition-duration: 0.4s;
}

.wrap:hover .panel {
  opacity: 1;
}
Try It Yourself

How It Works

opacity is GPU-friendly and ideal for show/hide UI without layout shifts.

Example 4 — Transform and box-shadow

Animate lift and shadow together while leaving background as an instant change.

multi.css
.card {
  transition-property: transform, box-shadow;
  transition-duration: 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
Try It Yourself

How It Works

Comma-separated property names share the same duration and timing unless you set them individually per property in the shorthand.

♿ Accessibility

  • Do not rely on motion alone — Ensure state changes are visible without animation.
  • Reduced motion — Set transition-property: none when prefers-reduced-motion: reduce is active.
  • Focus states — Include focus-visible properties (e.g., outline-color, box-shadow) in your transition list when styling keyboard focus.
  • Avoid animating layout — Properties like width can cause reflow; prefer transform for motion effects.

property + duration + timing

transition-property names what animates; you still need duration (and optionally delay and timing function) for the effect to run.

full-stack.css
.btn {
  transition-property: background-color, transform;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

/* Shorthand equivalent */
.btn {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

🧠 How transition-property Works

1

Properties are listed

Choose none, all, or specific property names.

Setup
2

State changes

Hover, focus, or a class toggle updates CSS values.

Trigger
3

Browser checks the list

Listed properties animate; unlisted properties change instantly.

Filter
=

Controlled animation

Only the properties you chose transition smoothly.

Browser Compatibility

The transition-property property is supported in all modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Modern browsers · Widely supported

Property targeting everywhere

transition-property works in current Chrome, Firefox, Safari, Edge, and Opera as part of the CSS Transitions module.

98% Browser support
Google Chrome 26+ · Desktop & Mobile
Full support
Mozilla Firefox 16+ · Desktop & Mobile
Full support
Apple Safari 6.1+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 12.1+ · All versions
Full support

Testing tip

Some properties (like display) are not animatable. Stick to common properties such as opacity, transform, and colors for reliable transitions.

transition-property property 98% supported

Bottom line: transition-property is reliable for choosing which CSS properties animate in modern browsers.

Conclusion

The transition-property property is a powerful feature in CSS that allows developers to create smooth transitions and animations.

By specifying which properties should transition when their values change, you can enhance the interactivity and visual appeal of your website. Experiment with different properties and transition effects to see how they can improve the user experience of your web projects.

💡 Best Practices

✅ Do

  • List specific properties instead of all when possible
  • Prefer transform and opacity for performance
  • Always pair with transition-duration
  • Use comma-separated lists for multi-property effects
  • Set none under prefers-reduced-motion

❌ Don’t

  • Rely on all without understanding side effects
  • Expect non-animatable properties like display to transition
  • Animate layout properties (width, height) when transform works
  • Forget to list properties you actually want to animate

Key Takeaways

Knowledge Unlocked

Five things to remember about transition-property

Use these points when choosing what to animate.

5
Core concepts
🕐 02

all

Default value.

Default
🚫 03

none

Disable.

Keyword
📚 04

Lists

Comma-separated.

Syntax
05

transform

Best for motion.

Pattern

❓ Frequently Asked Questions

transition-property specifies which CSS properties should animate smoothly when their values change, such as on hover or when a class is toggled.
The default is all, which means every animatable property that changes will transition.
Listing specific properties like transform and opacity is usually better for performance and predictable behavior. Use all only when you intentionally want every changed property to animate.
Yes. Provide a comma-separated list such as transition-property: width, background-color;
No, transition-property is not inherited. Set it on each element that needs transitions.

Practice in the Live Editor

Open the HTML editor and experiment with transition-property lists on hover effects.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful