您好,登錄后才能下訂單哦!
會(huì)動(dòng)的小球,設(shè)計(jì)html,css知識(shí)點(diǎn),另外動(dòng)畫是完全用css做的,很簡(jiǎn)單便捷哦~這只是一個(gè)小小的案例 ,以后為大家提供更多的案例!!
會(huì)動(dòng)的小球
<!DOCTYPE html>
**<html>
<head>
<meta charset="UTF-8">
<title>CSS3 loading圖標(biāo)</title>
<link rel="stylesheet" href="css/loading.css" />
</head>
<body>
<div id="loading-3">
<span class="item item-1"></span>
<span class="item item-2"></span>
</div>
</body>
</html>
```**``
css部分:
div#loading-3{
position: relative;
width: 160px;
height: 80px;
margin: 100px auto;
}
div#loading-3 span.item{
display: block;
position: absolute;
top: 25px;
width: 30px;
height: 30px;
border-radius: 50%;
animation-duration: 1.2s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-direction: alternate;
}
div#loading-3 span.item.item-1{
left: 25px;
background-color: #2ecc71;
animation-name: loading_green;
}
div#loading-3 span.item.item-2{
right: 25px;
background-color: #e74c3c;
animation-name: loading_red;
}
@keyframes loading_green{
0%{
left: 25px;
width: 30px;
height: 30px;
background-color: #2ecc71;
}
50%{
left: 100px;
width: 40px;
height: 40px;
background-color: #9b59b6;
}
100%{
left: 25px;
width: 30px;
height: 30px;
background-color: #e74c3c;
}
}
@keyframes loading_red{
0%{
right: 25px;
width: 30px;
height: 30px;
background-color: #e74c3c;
}
50%{
right: 100px;
width: 40px;
height: 40px;
background-color: #9b59b6;
}
100%{
right: 25px;
width: 30px;
height: 30px;
background-color: #2ecc71;
}
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。