简体   繁体   English

IE中的CSS过渡问题

[英]CSS Transition Problems in IE

I have a problem with HTML and CSS . 我对HTMLCSS有问题。 So I have a CSS style for my list but in IE it doesn't work. 所以我的列表有CSS样式,但在IE中不起作用。

Here is my HTML file: 这是我的HTML文件:

<ul class="main-ul2">
    <li><a href="#"><span>Home</span></a></li>
    <li><a href="#"><span>Article</span></a></li>
    <li><a href="#"><span>Blog</span></a></li>
    <li><a href="#"><span>Gallery</span></a></li>
</ul>

And here is my CSS file: 这是我的CSS文件:

.main-ul2 li {
    margin-left: 0;
    float:left;
    position:relative;
    width:25%;
    text-align:center;
    }
.main-ul2 li a {

    display:block;
    padding-bottom: 20px;
    padding-right:10px;
    padding-top: 10px;
    padding-left:10px;
    text-decoration:none;
    position: relative;
    z-index: 100;
    background-color: rgba(164, 164, 164, 0.2);
    –ms-??transition: all 1s;
    -webkit-transition: all 1s;
   -moz-transition: all 1s;
   -o-transition: all 1s;
   transition: all 1s;
}
.main-ul2 li a span{
   display:block;
   padding-top:10px;
   font-weight:700;
   font-size: 20px;
   color: rgba(120, 120, 120, 0.9);
   text-transform:uppercase;
   font-family: 'Kotta One', serif;

.main-ul2 li:hover span{
   color: #fff;
}

.main-ul2 li:nth-child(1):hover a{
background-color: rgba(175,54,55,0.8);
–ms-transform:rotate(-3deg);
-moz-transform: rotate(-3deg);
-webkit-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.main-ul2 li:nth-child(2):hover a{
   background-color: rgba(199, 204, 73, 0.8);
   –ms-transform:rotate(-3deg);
   -moz-transform: rotate(-3deg);
   -webkit-transform: rotate(-3deg);
   -o-transform: rotate(-3deg);
   transform: rotate(-3deg);
}
.main-ul2 li:nth-child(3):hover a{
   background-color: rgba(213, 135, 11, 0.8);
   –ms-transform:rotate(3deg);
   -moz-transform: rotate(3deg);
   -webkit-transform: rotate(3deg);
   -o-transform: rotate(3deg);
   transform: rotate(3deg);
}
.main-ul2 li:nth-child(4):hover a{
   background-color: rgba(51, 143, 144, 0.8);
   –ms-transform:rotate(3deg);
   -moz-transform: rotate(3deg);
   -webkit-transform: rotate(3deg);
   -o-transform: rotate(3deg);
   transform: rotate(3deg);
}

So if you are using Google Chrome you can insert my code in CCS Desk or any other online CSS editors and everything works fine (bullets are changing color and moving), but if you open my code in IE you'll see that it's not working fine. 因此,如果您使用的是Google Chrome浏览器 ,则可以将我的代码插入CCS Desk或任何其他在线CSS编辑器中,并且一切正常(子弹改变颜色并移动),但是如果您在IE中打开我的代码,则会发现它无法正常工作精细。

I have search for it in Google , and I found that I need to add Microsoft transform . 我在Google中进行了搜索,发现需要添加Microsoft转换

So can someone tell me how can I add Microsoft transform or if there any other way to fix this? 那么有人可以告诉我如何添加Microsoft Transformation或是否有其他方法可以解决此问题?

Thanks. 谢谢。

IE10 indicates that you can drop the -ms- prefix and use the base property. IE10指示您可以删除-ms-前缀并使用base属性。 That said, I would continue to use it to support older browsers. 也就是说,我将继续使用它来支持较旧的浏览器。

If you include the -o- and -webkit- you should be good to go with most recent browsers. 如果包含-o--webkit- ,最好使用最新的浏览器。 -moz- is also available if you need to support old versions of Firefox. 如果需要支持旧版本的Firefox,也可以使用-moz-

If you really need to support old browsers (as far as IE6), you should probably utilize JavaScript because....well...anything before IE9 was pretty bad. 如果您确实需要支持旧版浏览器(就IE6而言),则可能应该使用JavaScript,因为........在IE9之前的任何事情都非常糟糕。

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

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