CSS3 animation @keyframes 规则 动态效果

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
    width:100px;
    height:100px;
    background:red;
    position:relative;
    animation:mymove 5s infinite;
    -moz-animation:mymove 5s infinite; /* Firefox */
    -webkit-animation:mymove 5s infinite; /* Safari and Chrome */
    -o-animation:mymove 5s infinite; /* Opera */
}

@keyframes mymove
{
    from {top:0px;}
    to {top:200px;height:300px;}
}

@-moz-keyframes mymove /* Firefox */
{
    from {top:0px;}
    to {top:200px;height:300px;}
}

@-webkit-keyframes mymove /* Safari and Chrome */
{
    from {top:0px;}
    to {top:200px;height:300px;}
}

@-o-keyframes mymove /* Opera */
{
    from {top:0px;}
    to {top:200px;height:300px;}
}
</style>
</head>
<body>
    <p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
    <div></div>
</body>
</html>

posted @ 2017-11-03 19:39  盘思动  阅读(477)  评论(0)    收藏  举报