HTML Dog
跳至导航

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.  */

浏览器支持

css-transitions 支持情况? 来自 caniuse.com 的关于 css-transitions 功能在各大浏览器中支持情况的数据。