简体   繁体   English

IE8 CSS旋转

[英]IE8 CSS rotation

I'm looking for CSS solution for rotating elements in IE8. 我正在寻找IE8中旋转元素的CSS解决方案。 Some of solutions I've found say that it should work in IE8, but it does not for me. 我发现的一些解决方案说它应该在IE8中运行,但它不适合我。 What I do wrong? 我做错了什么?

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)

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 IE that might help you 另请看这个问题: IE中的CSS旋转属性可能对您有所帮助

Well, I dont think the filters for rotation work in a elegant way in IE8. 好吧,我不认为旋转过滤器在IE8中以优雅的方式工作。 I also tried that, but it didnt work for me properly. 我也试过了,但它对我没有用。 I tried using jquery rotate plugin. 我尝试使用jquery旋转插件。 You can try that out - http://code.google.com/p/jqueryrotate/ 你可以尝试一下 - 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中的问题 ),但它可能会帮助你,以防万一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM