如何重置 CSS transform
属性 CSS translate
值?
假设我有:
div.someclass {
-webkit-transform: translate3d(0, -50%, 0);
-moz-transform: translate(0, -50%);
-ms-transform: translate(0,- 50%);
-o-transform: translate(0, -50%);
transform: translate3d(0, -50%, 0);
}
那么如何清除所有转换/翻译?
我应该使用: translate(0, 0);
/translate3d(0, 0, 0);
还是 transform:auto;
?
最佳答案
根据 MDN documentation , Initial value是无
。
您可以使用以下方式重置转换:
div.someclass {
transform: none;
}
使用供应商前缀:
div.someclass {
-webkit-transform: none; /* Safari and Chrome */
-moz-transform: none; /* Firefox */
-ms-transform: none; /* IE 9 */
-o-transform: none; /* Opera */
transform: none;
}
关于css - 如何重置 CSS3 *-transform : translate(…)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7790617/