2013-01-24 15 views
5

私は次のコードを試していますが、どのような種類の遷移も見ていません。RGBA BackgroundプロパティはCSS3トランジションでサポートされていませんか?

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

このような移行はサポートされていませんか?ホバーが正常に動作していますが、私はちょっと変わっていません。

+1

[それは私の作品](のhttp:// jsfiddleは.net/sNyVq /)。あなたはどのブラウザをテストしていますか? IE9以下はCSSの遷移をサポートしていません。 –

答えて

13

RGBAの背景はCSS3でサポートされています。ホバー状態で変更するために、初期状態のバックグラウンドプロパティを指定する必要があります。

ここでは、必要なコードです:

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

}

、あなたがそれを必要とする場合には働いて、それとフィドル:http://jsfiddle.net/TAMA2/

関連する問題