炫酷的变色龙

4 篇文章 0 订阅

实现一个运动且持续变换色彩的变色龙
在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>五光十色的变色龙</title>
		<style type="text/css">
			.wrap{
				width: 440px;
				height: 440px;
				position: relative;
				left: 50%;
				margin-top: 200px;
				margin-left: -220px;
				overflow: hidden;		
			}			
			.bsl,.colorbg,.colorbg-wrap,.dongdong,.bg1,.colorbg-wrap1{
				position: absolute;
			}
			.bsl{
				left: 50%;
				top: 50%;
				width: 170px;
				height: 170px;	
				margin-left: -85px;
				margin-top: -85px;
				z-index: 6;
			}
			.colorbg-wrap{
				width: 170px;
				height: 170px;
				left: 50%;
				top: 50%;
				width: 170px;
				height: 170px;	
				margin-left: -85px;
				margin-top: -85px;
				overflow: hidden;
				z-index: 5;
			}
			.colorbg{
				width: 984px;
				height: 984px;
				z-index: 4;
				left: -180px;
				top: -70px;
				animation: rotate 10s linear infinite;
			}
			.dongdong{
				width: 440px;
				height: 440px;
				animation: rotate 20s linear infinite;
				z-index: 3;
				animation: rotate 30s linear infinite;
			}
			.colorbg-wrap1{
				width: 440px;
				height: 440px;
				z-index: 2;
				border-radius: 50%;
				overflow: hidden;
			}
			.bg1{
				z-index: 1;
			}
			@keyframes rotate{
				0%{
					transform: rotate(0deg);
				}
				100%{transform: rotate(360deg);}
			}	
		</style>
	</head>
	<body>
		<div class="wrap">
			<div class="bsl"><img src="img/chameleon.png"/></div>
			<div class="colorbg-wrap">
				<div class="colorbg"><img src="img/palette.jpg"/></div>
			</div>
			<div class="dongdong"><img src="img/dong.png"/></div>
			<div class="colorbg-wrap1">
				<div class="colorbg bg1"><img src="img/palette.jpg"/></div>
			</div>
		</div>
	</body>
</html>

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值