gpt4 book ai didi

css3 动画,淡入为下移?

转载 作者:太空狗 更新时间:2023-10-29 12:35:43 25 4
gpt4 key购买 nike

我正在学习如何制作 css3 动画。我怎样才能让这个盒子在向下 move 时淡入淡出?

示例:http://jsfiddle.net/RtWTN/1/

<!DOCTYPE html>
<html>
<head>
<style>
div
{
width: 100px;
height: 100px;
background: red;
position: relative;
animation: mymove 3s ease-out forwards;
animation-iteration-count: 3;
}

@keyframes mymove
{
from { top: 0px;}
to { top: 200px;}
}
</style>
</head>
<body>


<div></div>

</body>
</html>

最佳答案

您可以向动画关键帧添加多个规则。

{
from {top:0px; opacity: 0;}
to {top:200px; opacity: 1;}
}

http://jsfiddle.net/T2DnG/1/

关于css3 动画,淡入为下移?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17322305/

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