我有以下演示:http: //jsfiddle.net/EHrk4/2/
#main是否有可能保持不透明度 1 ,直到我将鼠标悬停在超链接上,然后它变为 0.3?
HTML:
<div id="main">
<a href="#">hover me to fade out main</a>
</div>
CSS:
#main {
-webkit-transition: opacity 0.3s;
-moz-transition: opacity 0.3s;
-ms-transition: opacity 0.3s;
-o-transition: opacity 0.3s;
transition: opacity 0.3s;
height:400px;
width:400px;
background:red
}
#main:not(:hover) {
opacity: 0.3;
}
非常感谢您的任何指点。