gpt4 book ai didi

css - 尽管两个代码都有效,但两个动画并未同时发生。为什么?

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:17 25 4
gpt4 key购买 nike

为什么“arrowDiv”和“arrow”这两个元素的动画效果不正确。图像应该显示为箭头上下弹跳。只有一个元素(箭头类)具有动画效果。 Div arrowDiv 保持不变。

背景图片仅供引用。

.animatedSection {
width:100%;
height: 540px;
overflow-x: hidden;
overflow-y: hidden;
}

.allpics {
position: relative;
top: -30px;
left: 20%;
width: 100%;
height: 100%;
animation-name: slideDiagonalAll;
animation-iteration-count: 1;
animation-duration: 2s;
animation-timing-function: ease;
transform: rotate(-15deg) scaleY(1) skewX(30deg);
animation-delay: 2s;

.arrowDiv.{
position: absolute;
left:450px;
top:200px;
z-index: 100;
height: 500px;
width: 500px;
background-color: black;
animation-name: arrowDown;
animation-iteration-count: infinite;
animation-duration: 2s;
animation-timing-function: ease;
animation-direction: alternate;
/* animation-fill-mode: backwards; /*check if forwards*/
}

.arrow{
z-index: inherit;
animation-name: appear;
animation-iteration-count:1;
animation-duration:5s;
animation-timing-function: linear;
animation-delay: 4s;

-webkit-filter: drop-shadow(-15px 10px 5px rgba(0,0,0,0.7));
filter: drop-shadow(-15px 10px 5px rgba(0,0,0,0.7));
}

@keyframes slideDiagonalAll {
0% {
transform: translate(150px, 150px) rotate(-15deg) scaleY(1) skewX(30deg);
}
100% {
transform: translate(0px, 0px) rotate(-15deg) scaleY(1) skewX(30deg);
}
}

@keyframes arrowDown{
0% {
transform: translate(0px, 0px);
}
100% {
transform: translate(0px, 10px);
}
}

@keyframes appear{
0% {opacity: 0;}
100% {opacity: 1;}
}
<div class="animatedSection">
<div class="allpics">
<div class="arrowDiv">
<img class="arrow" src="http://i.imgur.com/o4Y1QK5.png?1">
</div>
<img class="pic1" src="http://i.imgur.com/LO7Wtdy.jpg"/>
</div>
</div>

最佳答案

这里有一个错误。在类声明之后你有一个句号:

.arrowDiv.{

关于css - 尽管两个代码都有效,但两个动画并未同时发生。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35284835/

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