Home  >  Q&A  >  body text

javascript - How to use js or css3 to achieve the dynamic effect of element borders, as shown in the figure?

The aperture can be one, just like the avatar frame of King of Glory, how can it be realized?

仅有的幸福仅有的幸福2689 days ago1172

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-06-30 09:59:39

    <!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>

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-30 09:59:39

    Use css3 animation properties and transform

    reply
    0
  • Cancelreply