【发布时间】:2016-06-29 15:54:37
【问题描述】:
您好,我正在尝试使用底部而不是顶部来执行上下移动 div 以提供浮动/悬停效果的简单任务。所以从bottom: 63px 到bottom: 400px。
我是 CSS 和关键帧的新手!正如你可能会说的但这是我尝试过的,它似乎没有做任何事情:
.piece-open-space #emma {
background-image: url('images/perso/Emma.png?1418918581');
width: 244px;
height: 299px;
position: absolute;
display: block;
width: 244px;
background-image: none;
position: absolute;
left: 2149px;
bottom: 63px;
-webkit-animation: MoveUpDown 50s linear infinite;
}
@-webkit-keyframes MoveUpDown {
from {
bottom: 63px;
}
to {
bottom: 400px;
}
}
更新
问题是它不会循环,我正在寻找的目标是它达到 400 像素然后立即回到 63 像素我将如何让它达到 400 像素然后又回到 63 像素它给出的效果“悬停/浮动”的无限循环。
【问题讨论】:
-
@diogo “因为冲突”是什么意思?你用那个编辑解决了什么冲突?
标签: css css-animations