CSS 3 애니메이션 효과 데모

10757 단어 CSS

<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>CSS3  demotitle>
<meta name="author" content="" />
<style>
    *{margin:0;padding:0;}
    .box{
        position:absolute;
        left:200px;
        top:400px;
        height:100px;
        width:100px;
        background:red;
        color:#fff;
        font-size:20px;
        line-height:100px;
        text-align:center;
    }
    @keyframes boxmove{
        0%{
            top:350px;
            left:290px;
            font-size:20px;
            transform:rotateZ(0deg) scale(1.0);
            background:pink;
        }
        10%{
            top:320px;
            left:390px;
            font-size:24px;
            transform:rotateZ(45deg) scale(1.2);
            background:blue;
        }
        20%{
            top:310px;
            left:410px;
            font-size:26px;
            transform:rotateZ(75deg) scale(1.3);
            background:yellow;
        }
        30%{
            top:300px;
            left:520px;
            font-size:23px;
            transform:rotateZ(95deg) scale(1.5);
            background:yellow;
        }
        55%{
            top:270px;
            left:650px;
            font-size:22px;
            transform:rotateZ(155deg) scale(1.3);
            background:green;
        }
        75%{
            top:230px;
            left:770px;
            font-size:20px;
            transform:rotateZ(225deg) scale(1.2);
            background:#ccc;
        }
        100%{
            top:150px;
            left:1020px;
            font-size:18px;
            transform:rotateZ(360deg) scale(1.0);
            background:pink;
        }
    }
    .box{
        animation:boxmove 3s linear 0s infinite alternate;
    }
style>
head>
<body>
<div class="box">boxdiv>
body>
html>

좋은 웹페이지 즐겨찾기