Html IE8 CSS 旋转
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19176169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IE8 CSS rotation
提问by Simas Skilinskas
I'm looking for CSS solution for rotating elements in IE8. Some of solutions I've found say that it should work in IE8, but it does not for me. What I do wrong?
我正在寻找用于在 IE8 中旋转元素的 CSS 解决方案。我发现的一些解决方案说它应该在 IE8 中工作,但它不适合我。我做错了什么?
Here is what I tried:
这是我尝试过的:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
.rotate {
font-weight: bold;color: #000;background: #aa0;display: block;margin: 0 auto;width: 300px;height: 300px;top: 10%;text-align: center;line-height: 300px;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
</style>
</head>
<body>
<div class="rotate">
TESTING ROTATION
</div>
</body>
</html>
I would appreciate if you test your solution before answering, and it would be great ir you could just edit my given example and repost all code.
如果您在回答之前测试您的解决方案,我将不胜感激,如果您可以编辑我给定的示例并重新发布所有代码,那就太好了。
[EDIT]If anyone is still curious the problem is not the code, but the testing environment. You should use real IE8, but not IE8 emulator in IE10/IE11 (not sure about IE9)
[编辑]如果有人仍然好奇,问题不在于代码,而在于测试环境。您应该在 IE10/IE11 中使用真正的 IE8,而不是 IE8 模拟器(不确定 IE9)
回答by Bhojendra Rauniyar
You are missing IE vendor prefix -ms-
您缺少 IE 供应商前缀 -ms-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
So, Use this
所以,使用这个
-ms-filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* for IE8 */
Also look at this question: CSS rotate property in IEthat might help you
也看看这个问题:CSS rotate property in IEthat may help you
回答by whyAto8
Well, I dont think the filters for rotation work in a elegant way in IE8. I also tried that, but it didnt work for me properly. I tried using jquery rotate plugin. You can try that out - http://code.google.com/p/jqueryrotate/
好吧,我不认为旋转过滤器在 IE8 中以优雅的方式工作。我也尝试过,但它对我不起作用。我尝试使用 jquery 旋转插件。你可以试试 - http://code.google.com/p/jqueryrotate/
I have a issue even with that going on (jQueryRotate - Issue in IE8), but it might help you, just in case.
即使这样我也有问题(jQueryRotate - IE8 中的问题),但它可能会帮助你,以防万一。