CSS 属性:transition-property
应该应用过渡(外观随时间发生的渐变)的属性或属性。
可能的值
| 值 | 描述 | 示例 |
|---|---|---|
| [属性名称] | 应该过渡的属性。 | color |
[属性名称], [属性名称] | 多个属性名称可以用逗号分隔。 | color, background, opacity |
all | 所有属性都应该过渡。默认值。 | |
none | 不应过渡任何属性。 | |
inherit | ||
initial | ||
unset | ||
示例
a {
color: rgba(255,0,0,.5);
transition-property: color;
transition-duration: .3s;
}
/* A semi-transparent red link with a quick transition applied to the color property. */
a:hover {
color: rgba(255,0,0,1);
}
/* When hovered over, the color of the link will gradually turn solid red over 0.3 seconds. */
