五光十色变色龙的制作

在body里面创建盒子

<body>
    <div id="wrap">
        <div class="bianselong"></div>
        <div class="bg-box">
            <div class="bg"></div>
        </div>
        <div class="dong"></div>
        <div class="dong-box">
            <div class="bg1"></div>
        </div>
</div>
</body>

然后再css样式里面去修饰它:

    <style type="text/css">
        body,div{
            margin: 0;
            padding: 0;
        }
        body{
            font: 1em 'microsoft Yahei';
        }
        #wrap{
            position: relative;
            width: 440px;
            height: 440px;
            left: 50%;
            margin-left: -220px;
        }
        .bianselong,.bg-box{
            position: absolute;
            width: 170px;
            height: 170px;
            left: 50%;
            margin-left: -85px;
            top: 50%;
            margin-top: -85px;
        }
        .bianselong{
            z-index: 3;
            background: url(./images/chameleon.png) no-repeat;
        }
        .bg-box{
            overflow: hidden;
            z-index: 2;
        }
        .bg,.bg1{
            position: absolute;
            width: 984px;
            height: 984px;
            background: url(./images/palette.jpg) no-repeat;
            animation: rotate 10s linear infinite;
        }
        .bg{
            left: -200px;
            top: -200px;
        }
        .bg1{
            left: -300px;
            top: -300px;
        }
        .dong{
            position: absolute;
            width: 440px;
            height: 440px;
            background: url(./images/dong.png) no-repeat;
            z-index: 1;
            animation: rotate 60s linear infinite;
        }
        .dong-box{
            position: absolute;
            width: 400px;
            height: 400px;
            left: 50%;
            margin-left: -200px;
            top: 50%;
            margin-top: -200px;
            border-radius: 50%;
            z-index: 0;
            overflow: hidden;
        }
        @keyframes rotate{
            0%{
                transform: rotate(0);
            }
            100%{
                transform: rotate(360deg);
            }
        }
    </style>

查看效果图:

 此制作过程中需要的图如下所示:

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值