CSS3 Transitions不支持RGBA Background属性吗?

前端之家收集整理的这篇文章主要介绍了CSS3 Transitions不支持RGBA Background属性吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试以下代码,但我没有看到任何类型的过渡.
#menu .col_1 a{
    -webkit-transition: all .5s ease-out 0.1s;
    -moz-transition: all .5s ease-out 0.1s;
    -o-transition: all .5s ease-out 0.1s;
    transition: all .5s ease-out 0.1s;
}

#menu .col_1 a:hover{
    background-color: rgb(255,255,255);
    background-color: rgba(255,0.5);
    /* For IE 5.5 - 7*/
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000);
    /* For IE 8*/
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000)";
}

我搞砸了什么或是不支持这种转变?悬停工作正常,我只是没有看到任何转换.

解决方法

CSS3支持RGBA背景.您需要为初始状态提供后台属性,以便在悬停状态下更改.

这是您需要的代码

#menu .col_1 a {
-webkit-transition: all .5s ease-out 0.1s;
-moz-transition: all .5s ease-out 0.1s;
-o-transition: all .5s ease-out 0.1s;
transition: all .5s ease-out 0.1s;
background-color: rgba(0,1);
color: red;
}

#menu .col_1 a:hover {
background-color: rgb(255,255);
background-color: rgba(255,0.5);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000)";

}

如果你需要的话,可以使用它:http://jsfiddle.net/TAMA2/

原文链接:https://www.f2er.com/css/214857.html

猜你在找的CSS相关文章