詳細CSS3animationプロパティ(B)
アニメーションの繰り返しカウント
アニメーションの繰り返し-countプロパティ
オブジェクトのアニメーションを取得または設定するためのサイクル数
文法
アニメーションの繰り返しカウント:無限| <番号>。
パラメータ説明
<番号>は、デフォルト値が「1」である数であり、サイクルの無限無数
プログラミング演習
我々は、我々は回転バーの太極拳図を一緒に達成し、アニメーションの知識を学びました。
タスク
- 通常は白、通常は赤、静的円で作られた、などそのサイズ、ボーダー、場所を制御するためのdiv、使用のCSSを作成します。
- DIV要素を擬似し、適切な場所に配置すること太極拳パターンを作る二つのリングを描きます
- アニメーションを作成します
- 繰り返しプロパティは、ループを聞かせて、アニメーションを定義します
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3animation属性详解(二)</title>
<style type="text/css">
div{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
box-sizing: border-box;
width: 400px;
height: 400px;
margin: auto;
border: 1px solid red;
border-bottom: 200px solid red;
border-radius: 50%;
transform-origin: 50% 50%;
animation-name: rotate;
animation-duration: 5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
div:before{
content: "";
float: left;
width: 50px;
height: 50px;
border: 75px solid red;
background-color: white;
margin-top: 100px;
border-radius: 50%;
}
div:after{
content: "";
float: right;
width: 50px;
height: 50px;
border: 75px solid white;
background-color: red;
margin-top: -200px;
border-radius: 50%;
}
@keyframes rotate{
from{transform: rotate(0deg);}
to{transform: rotate(360deg);}
}
</style>
</head>
<body>
<div></div>
</body>
</html>