The aperture can be one, just like the avatar frame of King of Glory, how can it be realized?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .boxA { position: relative; width: 200px; height: 200px; border:2px solid yellow; } .boxB { position: absolute; width: 10px; height: 10px; top: 0; left: 0; background-color: pink; animation: mymove linear 5s infinite; } @keyframes mymove { 25% { transform: translate(190px,0px); } 50% { transform: translate(190px,190px); } 75% { transform: translate(0px,190px); } 100% { transform: translate(0px,0px); } } </style> </head> <body> <p class="boxA"> <p class="boxB"></p> </p> </body> </html>
Use css3 animation properties and transform
Use css3 animation properties and transform