1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Border Animation</title> <style> body { background: #000000; } .border-box { width: 200px; height: 200px; box-shadow: 16px 14px 20px #000000; border-radius: 10px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; justify-content: center; align-items: center; overflow: hidden; } .border-box:before { content: ''; background-image: conic-gradient(#ff0052 20deg, transparent 120deg); width: 150%; height: 150%; position: absolute; border-radius: 10px; animation: rotate 2s linear infinite; } .border-box:after { content: 'Animation'; width: 190px; height: 190px; line-height: 190px; text-align: center; background: #000000; color: red; position: absolute; border-radius: 10px; letter-spacing: 5px; box-shadow: inset 20px 20px 20px #000000; } @keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } } </style> </head> <body> <div class="border-box"></div> </body> </html>
|