<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>搞代码-CSSLoading(加载)动画效果3-CSS应用实例(gaodaima.com)</title> <style> .loader { border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid blue; border-right: 16px solid green; border-bottom: 16px solid red; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </head> <body> <h2>加载样式</h2> <p><strong>注意:</strong> -webkit- 和 -ms- 前缀用于那些不支持 animation 和 transform 属性的浏览器。</p> <div class="loader"></div> </body> </html>
本文案例为大家展示了《CSSLoading(加载) 动画效果3》的代码,若要看代码效果请大家点击“运行代码”按钮。
[code]<!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <title>搞代码-CSSLoading(加载)动画效果3-CSS应用实例(gaodaima.com)</title> <style> .loader { border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid blue; border-right: 16px solid green; border-bottom: 16px solid red; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </head> <body> <h2>加载样式</h2> <p><strong>注意:</strong> -webkit- 和 -ms- 前缀用于那些不支持 animation 和 transform 属性的浏览器。</p> <div class=”loader”></div> </body> </html>[/code]