Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is RGBA Background property not supported by CSS3 Transitions?

Tags:

css

I am trying the following code but I am not seeing any kind of transition.

#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, 255, 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)";
}

Did I mess something up or is this type of transition not supported? The hover is working correctly, I just don't see any transition.

like image 230
proseidon Avatar asked Jan 24 '13 21:01

proseidon


1 Answers

RGBA backgrounds are supported by CSS3. You need to supply a background property for the initial state in order for it to change on the hover state.

Here's the code you need:

#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,0,0,1);
color: red;
}

#menu .col_1 a:hover {
background-color: rgb(255, 255, 255);
background-color: rgba(255, 255, 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)";

}

and a fiddle with it working in case you need it: http://jsfiddle.net/TAMA2/

like image 63
DMTintner Avatar answered Sep 22 '22 07:09

DMTintner