gpt4 book ai didi

html - 鼠标悬停时CSS3滑动div

转载 作者:行者123 更新时间:2023-11-28 03:35:52 25 4
gpt4 key购买 nike

我想让一个 div 滑过另一个向后的 div,但不知道如何使用任何提示?我可以制作动画,但是当我将鼠标悬停在动画上时无法正常工作,有人可以解释为什么吗?

<!DOCTYPE html>
<html>
<head>
<style>
.fundo_main {
width:200px;
height:200px;
background-color:red;
position:relative;
}
.fundo_main:hover {
width:200px;
height:200px;
-webkit-animation-name:myfirst;
position:relative;
}
.fundo {
width:200px;
height:200px;
background-color:red;
position:relative;
-webkit-animation-name:myfirst;
}

.fundo:hover {
width:200px;
height:200px;
background-color:blue;
-webkit-animation-name:myfirst;
-webkit-animation-duration:.3s;
-webkit-animation-timing-function:linear;
-webkit-animation-direction:left;

}
@-webkit-keyframes myfirst {
0% { width:0px; }
65% { width: 150px;}
100% { width:200px; }
}
</style>
</head>
<body>
<div class="fundo_main">
<div class="fundo"></div>
</div>
</body>
</html>

最佳答案

我会说改变这个:

.fundo:hover

给这个:

.fundo_main:hover .fundo

关于html - 鼠标悬停时CSS3滑动div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14426781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com