作者:huyuping6215 | 来源:互联网 | 2023-02-01 13:53
我已经为这个问题创建了一个简单的JSFiddle.这是链接:https:
//jsfiddle.net/tnkh/Loewjnr3/
CSS:
.container{
background: white;
display:flex;
justify-content: center;
align-items: center;
height:50px
}
.circle {
display: inline-block;
width: 20px;
height: 20px;
background: #0f3757;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
margin-left:10px;
float:left;
transition: all 0.3s ease
}
.circle:hover {
background:orange;
}
基本上在这里,我可以悬停在任何圆圈上来改变它们的颜色.我想问一下,在鼠标移到白色容器后,我怎么能让橙色保持在我徘徊的任何特定圆圈上?
我可以使用任何脚本或CSS动画来解决问题?