使用HTML写动态图画

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>动画</title>
        <style type="text/css">
            /* 动画:
            1.创建关键帧:
            2.绑定动画:
             */
            .box1{
                width: 300px;
                height: 300px;
                background-color: pink;
                /* 2.绑定动画:
                   animation:动画名称,持续时间
                   infinite:无限的
                */
                animation: change 5s infinite;
            }
            /* 1.创建关键帧: */
            @keyframes change{
                from{  /* 开始帧 */
                    width: 300px;
                    height: 300px;
                    transform: rotate(0);
                }
                to{   /* 结束帧 */
                    width: 1200px;
                     height: 100px;
                     transform: rotate(360deg);
                }
                /* 百分比控制时间,在某一秒时的状态
                0%(0秒时){
                    width: ;
                    height: ;
                    transform: ;
                }
                30%(3秒时){
                    width: ;
                    height: ;
                    transform: ;
                }
                50%,70%(5秒-7秒时,保持某种状态一段时间){
                    width: ;
                    height: ;
                    transform: ;
                }
                100%{
                    width: ;
                    height: ;
                    transform: ;
                }
             */
            /*方便在各个网站运行
             @-webkit-keyframes name{
                from{}
                to{}
            }
            @-moz-document name{
                from{}
                to{}
            }
            @-ms-viewport name{
                from{}
                to{}
            } */
        </style>
    </head>
    <body>
        <div class="box1"></div>
    </body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值