2
.box {
width: 100px;
height: 100px;
background: blue;
}
.circle {
margin-top: 20px;
width: 80px;
height: 80px;
border-radius: 100%;
background: red;
opacity: 0;
transition: opacity 0.5s ease;
}
.box:hover + .circle {
opacity: 1;
}
<body>
<div class="box">
</div>
<div class="circle">
</div>
</body>
在这里,当我将鼠标悬停在.box
,.circle
消失在0.5秒。
现在,当我将光标从.box
移开时,我想.circle
以不同的速度(比如1s)淡出。如何使它发生?