547 views
CSSAdd prefixes
1.loader { 2 position: relative; 3 width: 40px; 4 height: 40px; 5 border-radius: 50%; 6} 7 8.loader::before, 9.loader::after { 10 content: ""; 11 position: absolute; 12 border-radius: inherit; 13} 14 15.loader::before { 16 width: 100%; 17 height: 100%; 18 background-image: linear-gradient(0deg, #ff00cc 0%, #333399 100%); 19 animation: load012323 .5s infinite linear; 20} 21 22.loader::after { 23 width: 85%; 24 height: 85%; 25 background-color: #222; 26 top: 50%; 27 left: 50%; 28 transform: translate(-50%, -50%); 29} 30 31@keyframes load012323 { 32 to { 33 transform: rotate(360deg); 34 } 35}
HTML
1<div class="loader"></div>