寻找线索,如何在过渡时使用背景颜色的不透明度?
我正在使用rgba()功能,但转换不适用于悬停.
.bx{
background:rgba(255,0,0,0.5);
width:100px; height:100px;
position:relative;
transition: opacity .5s ease-out;
-moz-transition: opacity .5s ease-out;
-webkit-transition: opacity .5s ease-out;
-o-transition: opacity .5s ease-out;
}
.bx:hover{
background:rgba(255,0,0,1);
}
.t{
position:absolute;
bottom:0px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="bx"><div class="t">text</div></div>
Run Code Online (Sandbox Code Playgroud)
任何想法,我如何使用转换.bx?