210706 UIUX WebDesign CSS 연습_62

ITisIT210·2021년 7월 10일
0

CSS

목록 보기
83/93
post-thumbnail
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Animation</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: #f00;
            position: absolute;
            left: 0;
            top: 0;
            animation: boxAni 5s;
        }

        @keyframes boxAni {
            0% {
                position: absolute;
                left: 0;
                top: 0;
                background: #f00;
            }

            25% {
                position: absolute;
                left: 500px;
                top: 0;
                background: #ff0;
            }

            50% {
                position: absolute;
                left: 500px;
                top: 500px;
                background: #00f;
            }

            75% {
                position: absolute;
                left: 0;
                top: 500px;
                background: green;
            }

            100% {
                position: absolute;
                left: 0;
                top: 0;
                background: #f00;
            }
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>
profile
Engineering is the closest thing to magic that exists in the world.

0개의 댓글