过渡属性transition

过渡属性:使元素变化过程可见
transition: all 1s;元素所有变化过程都可见
transition: 1s;元素所有变化过程都可见
transition: 指定属性 2s 1s;指定属性变化过程可见,过渡时间2s,延迟1s,过渡时间和延迟时间顺便不可以调整

案例:

(1)html

<div></div>

(2)css

div{
width: 100px;
height: 100px;
background: red;
transition: width 2s,height 2s 1s;
}
div:hover{
width: 200px;
height: 200px;
background: lime;
}

猜你喜欢

转载自www.cnblogs.com/msw0803/p/11526195.html