1、控制单一属性,进行单一属性的样式过度
.class1 { width: 100px; transition: width 2s; -moz-transition: width 2s; /* Firefox 4 */ -webkit-transition: width 2s; /* Safari 和 Chrome */ -o-transition: width 2s; /* Opera */ } .class2 { width: 20px; }
2、控制多属性
.class1 { width: 100px; height: 100px; transition-property: width, height; transition-duration: 1s, 1s; } .class2 { width: 20px; height: 20px; }