css多个属性怎么写,具有多个属性的CSS过渡简写?

5c82b0ae871324ac67af16f35717a802.png

ibeautiful

如果您有想要以同样的方式过渡几个特定的属性(因为你也有你特别一些属性并不想转型,比方说opacity),另一种选择是做这样的事情(略去了前缀):.myclass {    transition: all 200ms ease;    transition-property: box-shadow, height, width, background, font-size;}第二个声明会覆盖其all上方的简短声明中的,并(有时)使代码更简洁。/* prefixes omitted for brevity */.box {    height: 100px;    width: 100px;    background: red;    box-shadow: red 0 0 5px 1px;    transition: all 500ms ease;    /*note: not transitioning width */    transition-property: height, background, box-shadow;}.box:hover {  height: 50px;  width: 50px;  box-shadow: blue 0 0 10px 3px;  background: blue;}

Hover box for demo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值