怎么用CSS3制作頁面圓圈加載動(dòng)畫?這個(gè)問題可能是我們?nèi)粘W(xué)習(xí)或工作經(jīng)常見到的。希望通過這個(gè)問題能讓你收獲頗深。下面是小編給大家?guī)淼膮⒖純?nèi)容,讓我們一起來看看吧!
成都創(chuàng)新互聯(lián)自2013年創(chuàng)立以來,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元麥蓋提做網(wǎng)站,已為上家服務(wù),為麥蓋提各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18982081108制作頁面加載動(dòng)畫需要用到很多CSS3中的屬性,比如:animation屬性,position定位,border-radius圓角,transform屬性等等,如有不清楚的同學(xué)可以看看我以前的文章,之前都有介紹過,或者訪問 CSS3視頻教程,這些都是基礎(chǔ),一定要掌握。
實(shí)例:制作一個(gè)圓圈加載動(dòng)畫效果,圓圈在加載時(shí)大小由小變大,顏色由淺變深,具體代碼如下:
HTML部分:
<div class="loader">
<div class="loading">
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
</div>
</div>CSS部分:
.loader{
width: 300px;
border: 1px solid #ccc;
height: 200px;
display: flex;
box-sizing: border-box;
align-items: center;
justify-content: center;
}
@-webkit-keyframes loading{
50%{
transform: scale(0.4);
opacity: 0.3;
}
100%{
transform: scale(1);
opacity: 1;
}
}
.loading{
position: relative;
}
.loading i{
display: block;
width: 15px;
height: 15px;
border-radius: 50%;
position: absolute;
background: #333;
}
.loading i:nth-child(1){
top: 25px;
left: 0;
-webkit-animation: loading 1s ease 0s infinite;
}
.loading i:nth-child(2){
top: 17px;
left: 17px;
-webkit-animation: loading 1s ease 0.12s infinite;
}
.loading i:nth-child(3){
top: 0;
left: 25px;
-webkit-animation: loading 1s ease 0.24s infinite;
}
.loading i:nth-child(4){
top: -17px;
left: 17px;
-webkit-animation: loading 1s ease 0.36s infinite;
}
.loading i:nth-child(5){
top: -25px;
left: 0;
-webkit-animation: loading 1s ease 0.48s infinite;
}
.loading i:nth-child(6){
top: -17px;
left: -17px;
-webkit-animation: loading 1s ease 0.6s infinite;
}
.loading i:nth-child(7){
top: 0;
left: -25px;
-webkit-animation: loading 1s ease 0.72s infinite;
}
.loading i:nth-child(8){
top: 17px;
left: -17px;
-webkit-animation: loading 1s ease 0.84s infinite;
}效果圖:

感謝各位的閱讀!看完上述內(nèi)容,你們對(duì)怎么用CSS3制作頁面圓圈加載動(dòng)畫大概了解了嗎?希望文章內(nèi)容對(duì)大家有所幫助。如果想了解更多相關(guān)文章內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道。
分享標(biāo)題:怎么用CSS3制作頁面圓圈加載動(dòng)畫-創(chuàng)新互聯(lián)
網(wǎng)站鏈接:http://chinadenli.net/article22/cddpcc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、外貿(mào)建站、做網(wǎng)站、搜索引擎優(yōu)化、App設(shè)計(jì)、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容