css3 - css 3问题, transition:0.5s all;是指所有属性?
天蓬老师
天蓬老师 2017-04-17 11:45:58
0
3
1166

w3cSchool这样说的:

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
左手右手慢动作

That’s pretty much what the questioner said, but let’s be clear, all refers to everything,

p{
    width: 200px;
    height: 200px;
    margin: 300px auto;
    background-color: #336699;
    
    transition: all 1s;
    /*transition: height 1s;*/
}
p:hover{
    width: 300px;
    height: 400px;
}

I think all here refers to the style after the transition. The above code runs and the width and height of p change smoothly. When we change all to height, only the height transformation process has animation effects. width is an instant change.

黄舟

Yes, all can also be omitted without writing

黄舟

Yes, it is recommended to specify a certain attribute when using it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template