Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

transition-property — selecting properties to transition

transition-property selects CSS properties whose changes can trigger a transition. It does not set the duration or target values; those come from separate declarations.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

transition-property: none | <single-transition-property>#;
<single-transition-property> = all | <custom-ident>

transition-property selects properties to transition when their values change. Its initial value, all, covers every eligible property; none disables transitions. The property is not inherited and is itself not animatable. With default settings, transition-duration: 0s produces no gradual transition.

Supply comma-separated names, such as opacity, width. The grammar's # denotes this list. none must stand alone. Durations, delays, and timing functions match by position: shorter lists repeat and surplus values are ignored. When entries overlap, the last matching entry wins.

Shorthands select their longhand sub-properties. Listing a property does not make it animatable; discrete transitions require transition-behavior: allow-discrete. In the example, both width and opacity change, but only opacity transitions.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>transition-property</title>
<style>
  .box {
    width: 100px;
    height: 60px;
    background-color: navy;
    opacity: 1;
    transition-property: opacity;
    transition-duration: 1s;
    transition-timing-function: linear;
  }
  #toggle:checked ~ .box {
    width: 200px;
    opacity: 0.25;
  }
</style>
<input id="toggle" type="checkbox">
<label for="toggle">Toggle</label>
<div class="box"></div>
</html>

Result

Checking Toggle changes width immediately from 100px to 200px while opacity transitions from 1 to 0.25 over 1s. Unchecking after completion reverses both changes with the same timing.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources