想要實現loading加載動畫需要用到很多CSS3中的屬性和HTML標簽,比如:animation動畫,display,border-radius圓角,transform屬性等等,如有不清楚的小伙伴可以看看我以前的文章,之前都有介紹過,或者訪問 CSS3視頻教程 。
實例示范:用三個圓圈制作一個頁面加載動畫效果,圓圈由隱藏變為出現再變為隱藏,具體代碼如下:
HTML部分:
div >CSS3部分:
.spinner { margin: 100px auto 0; width: 150px; text-align: center; .spinner div { width: 30px; height: 30px; background-color: #67CF22; border-radius: 100%; display: inline-block; -webkit-animation: bouncedelay 1.4s infinite ease-in-out; animation: bouncedelay 1.4s infinite ease-in-out; /* Prevent first frame from flickering when animation starts */ -webkit-animation-fill-mode: both; animation-fill-mode: both; .spinner .bounce1 { -webkit-animation-delay: -0.32s; animation-delay: -0.32s; .spinner .bounce2 { -webkit-animation-delay: -0.16s; animation-delay: -0.16s; @-webkit-keyframes bouncedelay { 0%, 80%, 100% { -webkit-transform: scale(0.0) } 40% { -webkit-transform: scale(1.0) } @keyframes bouncedelay { 0%, 80%, 100% { transform: scale(0.0); -webkit-transform: scale(0.0); } 40% { transform: scale(1.0); -webkit-transform: scale(1.0); }效果如圖所示:
以上介紹了CSS3實現頁面loading加載動畫效果的方法,項目中用的比較多,可以直接拿過去使用,也可以修改成自己喜歡的樣式,希望這篇文章對你有所幫助!【相關教程推薦】
1. HTML視頻教程
2. CSS3在線手冊
3. bootstrap教程以上就是HTML+CSS實現頁面加載(loading)動畫效果的詳細內容,其它編程語言
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答