时间:2021-07-01 10:21:17 帮助过:33人阅读
-webkit-transform
也要类似写法吧
div
{
transform: translate(50px,100px);
-ms-transform: translate(50px,100px); /* IE 9 */
-webkit-transform: translate(50px,100px); /* Safari and Chrome */
-o-transform: translate(50px,100px); /* Opera */
-moz-transform: translate(50px,100px); /* Firefox */
}
你似乎需要一个触发事件
CSS3 IE兼容代码在线转换 IE's CSS3 Transforms Translator
演示代码
.trans { width: 100px; height: 100px; background-color: yellow;}.trans:hover {/* W3C CSS3 standard */ transform: translateX(20px); /* Firefox */ -moz-transform: translateX(20px); /* webkit (Chrome, Safari, mobile browsers, etc) */ -webkit-transform: translateX(20px); /* Opera */ -o-transform: translateX(20px); /* IE>=9 */ -ms-transform: translateX(20px); /* IE8+ - must be on one line, unfortunately */ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand')"; /* IE6 and 7 */ filter: progid:DXImageTransform.Microsoft.Matrix( M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand'); /* * To make the transform-origin be the middle of * the object. Note: These numbers * are approximations. For more accurate results, * use Internet Explorer with this tool. */ margin-left: 7px; margin-top: -3px; }
演示更新版
加上了transition