這篇文章主要為大家展示了“如何使用css實現(xiàn)計時功能”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學習一下“如何使用css實現(xiàn)計時功能”這篇文章吧。

成都創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:做網(wǎng)站、網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的甘肅網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Time Demo</title>
<style>
html, body {
height: 100%;
}
body {
font-family: "Microsoft Yahei";
font-size: 18px;
margin: 0;
padding: 0;
}
.site-wrapper {
display: table;
width: 100%;
height: 100%;
min-height: 100%;
}
.site-wrapper-inner {
vertical-align: middle;
display: table-cell;
}
.site-wrapper-content {
width: 240px;
margin: 0 auto;
text-align: center;
}
.time {
margin: 10px 0 0 80px;
padding: 0;
list-style: none;
}
.time:after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.time > li {
text-align: center;
float: left;
position: relative;
overflow: hidden;
width: 10px;
height: 20px;
line-height: 20px;
}
.time > li > div {
position: absolute;
line-height: 20px;
}
@keyframes step6 {
from {
top: 0;
}
to {
top: -120px;
}
}
@-moz-keyframes step6 /* Firefox */
{
from {
top: 0;
}
to {
top: -120px;
}
}
@-webkit-keyframes step6 /* Safari和 Chrome */
{
from {
top: 0;
}
to {
top: -120px;
}
}
@-o-keyframes step6 /* Opera */
{
from {
top: 0;
}
to {
top: -120px;
}
}
@keyframes step10 {
from {
top: 0;
}
to {
top: -200px;
}
}
@-moz-keyframes step10 /* Firefox */
{
from {
top: 0;
}
to {
top: -200px;
}
}
@-webkit-keyframes step10 /* Safari和 Chrome */
{
from {
top: 0;
}
to {
top: -200px;
}
}
@-o-keyframes step10 /* Opera */
{
from {
top: 0;
}
to {
top: -200px;
}
}
.min1 {
animation: step6 steps(6) 3600s infinite;
-moz-animation: step6 steps(6) 3600s infinite; /* Firefox */
-webkit-animation: step6 steps(6) 3600s infinite; /* Safari和 Chrome */
-o-animation: step6 steps(6) 3600s infinite; /* Opera */
}
.min2 {
animation: step10 steps(10) 600s infinite;
-moz-animation: step10 steps(10) 600s infinite; /* Firefox */
-webkit-animation: step10 steps(10) 600s infinite; /* Safari和 Chrome */
-o-animation: step10 steps(10) 600s infinite; /* Opera */
}
.sec1 {
animation: step6 steps(6) 60s infinite;
-moz-animation: step6 steps(6) 60s infinite; /* Firefox */
-webkit-animation: step6 steps(6) 60s infinite; /* Safari和 Chrome */
-o-animation: step6 steps(6) 60s infinite; /* Opera */
}
.sec2 {
animation: step10 steps(10) 10s infinite;
-moz-animation: step10 steps(10) 10s infinite; /* Firefox */
-webkit-animation: step10 steps(10) 10s infinite; /* Safari和 Chrome */
-o-animation: step10 steps(10) 10s infinite; /* Opera */
}
.mil1 {
animation: step10 steps(10) 1s infinite;
-moz-animation: step10 steps(10) 1s infinite; /* Firefox */
-webkit-animation: step10 steps(10) 1s infinite; /* Safari和 Chrome */
-o-animation: step10 steps(10) 1s infinite; /* Opera */
}
.mil2 {
animation: step10 steps(10) 0.1s infinite;
-moz-animation: step10 steps(10) 0.1s infinite; /* Firefox */
-webkit-animation: step10 steps(10) 0.1s infinite; /* Safari和 Chrome */
-o-animation: step10 steps(10) 0.1s infinite; /* Opera */
}
.mil3 {
animation: step10 steps(10) 0.01s infinite;
-moz-animation: step10 steps(10) 0.01s infinite; /* Firefox */
-webkit-animation: step10 steps(10) 0.01s infinite; /* Safari和 Chrome */
-o-animation: step10 steps(10) 0.01s infinite; /* Opera */
}
.min1, .min2, .sec1, .sec2, .mil1, .mil2, .mil3 {
animation-play-state: paused;
-moz-animation-play-state: paused; /* Firefox */
-webkit-animation-play-state: paused; /* Safari和 Chrome */
-o-animation-play-state: paused; /* Opera */
}
#start:checked ~ .time .min1,
#start:checked ~ .time .min2,
#start:checked ~ .time .sec1,
#start:checked ~ .time .sec2,
#start:checked ~ .time .mil1,
#start:checked ~ .time .mil2,
#start:checked ~ .time .mil3 {
animation-play-state: running;
-moz-animation-play-state: running; /* Firefox */
-webkit-animation-play-state: running; /* Safari和 Chrome */
-o-animation-play-state: running; /* Opera */
}
#stop:checked ~ .time .min1,
#stop:checked ~ .time .min2,
#stop:checked ~ .time .sec1,
#stop:checked ~ .time .sec2,
#stop:checked ~ .time .mil1,
#stop:checked ~ .time .mil2,
#stop:checked ~ .time .mil3 {
animation-play-state: paused;
-moz-animation-play-state: paused; /* Firefox */
-webkit-animation-play-state: paused; /* Safari和 Chrome */
-o-animation-play-state: paused; /* Opera */
}
#reset:checked ~ .time .min1,
#reset:checked ~ .time .min2,
#reset:checked ~ .time .sec1,
#reset:checked ~ .time .sec2,
#reset:checked ~ .time .mil1,
#reset:checked ~ .time .mil2,
#reset:checked ~ .time .mil3 {
animation: none;
-moz-animation: none; /* Firefox */
-webkit-animation: none; /* Safari和 Chrome */
-o-animation: none; /* Opera */
top: 0;
}
</style>
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="site-wrapper-content">
<input type="radio" name="control" id="start">
<label for="start">start</label>
<input type="radio" name="control" id="stop" checked>
<label for="stop">stop</label>
<input type="radio" name="control" id="reset">
<label for="reset">reset</label>
<ul class="time">
<li><div class="min1">0 1 2 3 4 5</div></li>
<li><div class="min2">0 1 2 3 4 5 6 7 8 9</div></li>
<li>:</li>
<li><div class="sec1">0 1 2 3 4 5</div></li>
<li><div class="sec2">0 1 2 3 4 5 6 7 8 9</div></li>
<li>.</li>
<li><div class="mil1">0 1 2 3 4 5 6 7 8 9</div></li>
<li><div class="mil2">0 1 2 3 4 5 6 7 8 9</div></li>
<li><div class="mil3">0 1 2 3 4 5 6 7 8 9</div></li>
</ul>
</div>
</div>
</div>
</body>
</html>
以上是“如何使用css實現(xiàn)計時功能”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
分享名稱:如何使用css實現(xiàn)計時功能
分享URL:http://www.chinadenli.net/article14/igppge.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊、商城網(wǎng)站、網(wǎng)站建設(shè)、網(wǎng)站排名、云服務(wù)器、靜態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)