我已经到处寻找有关这方面的更多信息,并且想知道为什么会这样。
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
<div style="position:absolute; top:200px; left:200px; height:200px; width:200px; border:1px solid black; filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.9886188373396114, M12=-0.15044199698646263, M21=0.15044199698646263, M22=0.9886188373396114);">
<div style="position:absolute; top:10px; left:10px; border:1px solid darkblue;">
I do not rotate in IE 8.
</div>
</div>
</body>
</html>
问题是使用 MS 的 dximagetransform.matrix 旋转的 div 中绝对或相对定位的元素不会继承 IE 8 中的转换。
IE 6 & 7 渲染正确,我可以通过触发兼容模式解决 IE8 问题,但我宁愿不这样做。有人对这个有经验么?我在其他浏览器上使用 css3 转换并在 IE 中使用 dximagetransform.matrix 来实现这种效果。
编辑:添加了开始的 html 标签。问题依然存在。
最佳答案
我神奇地解决了这个问题,只是将 z-index: 1
添加到带有矩阵过滤器的父元素。好吧,任何 z-index
都应该有效。
关于internet-explorer-8 - dximagetransform.matrix,在 IE 8 标准模式下绝对定位不旋转的子元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3055383/