短代码中转换属性的转换

时间:2017-05-31 06:08:04

标签: css css-transitions css-transforms

我对如何正确编写此代码感到困惑?

选项1:



.line-all {
  -webkit-transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
  transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}

.animated .line-all {
  -ms-transform: translate(0px, 3px) rotate(-45deg);
  -webkit-transform: translate(0px, 3px) rotate(-45deg);
  transform: translate(0px, 3px) rotate(-45deg);
}




选项2:



.line-all {
  -webkit-transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -webkit-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -ms-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
  transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -webkit-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -ms-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}

.animated .line-all {
  -ms-transform: translate(0px, 3px) rotate(-45deg);
  -webkit-transform: translate(0px, 3px) rotate(-45deg);
  transform: translate(0px, 3px) rotate(-45deg);
}




选项3:



.line-all {
  -webkit-transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -webkit-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99), -ms-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
  transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}

.animated .line-all {
  -ms-transform: translate(0px, 3px) rotate(-45deg);
  -webkit-transform: translate(0px, 3px) rotate(-45deg);
  transform: translate(0px, 3px) rotate(-45deg);
}




还有其他选择吗?或哪一个是从3以上的权利?

1 个答案:

答案 0 :(得分:0)

得到我的答案并且也很好地工作



.line-all {
  -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
  transition: transform 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}

.animated .line-all {
  -ms-transform: translate(0px, 3px) rotate(-45deg);
  -webkit-transform: translate(0px, 3px) rotate(-45deg);
  transform: translate(0px, 3px) rotate(-45deg);
}