2012-03-08 80 views
1

我要再问一个问题!CSS旋转IE7和8

所以,CSS旋转工作在IE9,但得到旋转工作在以前的版本将是我的死亡!

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); 

这行代码将元素旋转了90度,但是与其他浏览器的元素大致相同。如果元素太靠近页面,可能会将其旋转到外部。微软的IE文档并没有说清楚如何设置转换源。

我完整的代码:

#quick { 
    position:fixed; 
    top:250px; 
    left:-158px; 
} 
#qmenu-wrapper { 
    background-image: url(../images/img_08.png); 
    background-repeat:repeat-x; 
    height: 35px; 
    width:350px; 
    -webkit-transform: rotate(90deg); 
    -moz-transform: rotate(90deg); 
    -o-transform: rotate(90deg); 
    -ms-transform:rotate(90deg); 
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); 

} 

有什么我们可以做,使IE 7和8手柄旋转以同样的方式为9?

谢谢。

我!

+1

你可能要考虑尝试jQuery的旋转:http://code.google.com/p/jqueryrotate/的 – aroth 2012-03-08 02:43:05

+0

可能重复[CSS旋转在IE属性(http://stackoverflow.com/questions/4617220/css-rotate-property-in-ie) – Liam 2014-03-13 13:35:05

回答

4

IE5.5,IE6,IE7和IE8支持filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); IE5不支持它!

Source

要使用DX过滤器只需使用Matrix过滤器来改变你的元素的位置改变旋转原点。您可以在一个元素上使用多个过滤器。你需要做一点数学。祝你好运!

4

看看this site左侧的标题。我用overflow:visible将项目放置在一个较小的元素中并旋转该元素,从而解决了旋转点问题。换句话说,我做了我自己的支点。

在该示例中,我还使用书写模式来旋转IE中的文本,因为使用过滤器会禁用字体平滑。

<style type="text/css"> 
/* This wrapper is required to rotate the text around the left edge */ 

#page_title { 
overflow: visible; 
position: absolute; 
width: 38px; 
-moz-transform: rotate(90deg); 
-moz-rotation-point: 0 0; 
-webkit-transform: rotate(90deg); 
-webkit-rotation-point: 0 0; 
-o-transform: rotate(90deg); 
-ms-writing-mode: tb-lr; 
* html writing-mode: tb-lr; 
} 

#page_title h1 { 
display: block; 
font-size: 70px; 
font-weight: normal; 
line-height: 38px; 
color: #F3C1E0; 
font-variant: small-caps; 
width: auto; 
} 
</style> 

<div id="page_title"> 
<h1>Inwardpath&nbsp;Publishers</h1> 
</div> 
+0

这只适用于IE8及以上版本。 – 2015-01-06 14:39:01