css3 动画,作为下移淡入?

Ned*_*Ned 4 css animation move fadein

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

示例: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>
Run Code Online (Sandbox Code Playgroud)

Exp*_*lls 5

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

{
from {top:0px; opacity: 0;}
to {top:200px; opacity: 1;}
}
Run Code Online (Sandbox Code Playgroud)

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