利用css3画叮当猫

本文详细介绍了如何借助CSS3的特性,如边框、渐变、旋转和伪元素等,来创建一个生动的叮当猫图形。通过实例代码和步骤解析,展示了在HTML5页面中实现这一创意设计的方法。
摘要由CSDN通过智能技术生成

叮当猫

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.tou{
				width: 300px;
				height: 280px;
				background: #0bb1db;
				border-radius: 150px 150px 150px 150px;
				position: relative;
                left: -211px;
				right: 0;
				top: 0;
				bottom: 0;
				margin: 30px auto;
				border:2px solid #000;
				z-index:1;
			}
			.face{
				width: 230px;
				height: 230px;
				background: #ffffff;
				position: absolute;
				left: 36px;
				top: 49px;
				border-radius: 110px 110px 110px 110px;
				border:2px solid #000;
			}
			.eye1{
				position: absolute;
				left: 78px;
				top: 18px;
				width: 60px;
				height: 70px;
				background: #ffffff;
				border-radius: 110px 110px 110px 110px;
				border:2px solid #000;
			}
			.eye2{
				position: absolute;
				left: 142px;
				top: 18px;
				width: 60px;
				height: 70px;
				background: #ffffff;
				border-radius: 110px 110px 110px 110px;
				border:2px solid #000;
			}
			.blackeye1{
				position: absolute;
				left: 110px;
				top: 67px;
				width: 15px;
				height: 15px;
				background: #000;
				border-radius: 110px 110px 110px 110px;
			}
			.blackeye2{
				position: absolute;
				left: 160px;
				top: 67px;
				width: 15px;
				height: 15px;
				background: #000;
				border-radius: 110px 110px 110px 110px;
			}
			.nose{
				position: absolute;
				left: 128px;
				top: 79px;
				width: 25px;
				height: 25px;
				background: #ca3e01;
				border:2px solid #000;
				border-radius: 110px 110px 110px 110px;
				
			}
			.mouth{
				 width:220px;
	             height:400px;
	             border-bottom:3px solid #333;
	             border-radius:110px;
	             position:absolute;
	             top:-192px;
	             left:35px;
			}
			.xian{
				 width:3px;
	             height:100px;
	             background:#333;
	             position:absolute;
	             top:108px;
	             left:142px;
			}
			.huxu{
				width: 60px;
	            height: 2px;
	            background: #333;
	            position: absolute;
			}
			.huxu1{
				top:148px;
	            left:65px;
			}
			.huxu2{
				top:148px;
	            left:167px;
			}
			.huxu3{
				top:130px;
	            left:65px;
	            transform: rotate(20deg);
			}
			.huxu4{
				top:166px;
	            left:65px;
	            transform: rotate(-14deg);
			}
			.huxu5{
				top:128px;
	            left:165px;
	            transform: rotate(-24deg);
			}
			.huxu6{
				top:166px;
	            left:165px;
	            transform: rotate(20deg);
			}
			.weibo{
				width: 230px;
	            height: 20px;
	            background: #a82300;
	            border: 2px solid #000;
	            border-radius: 10px;
	            position: relative;
	            top: -40px;
	            left: 341px;
	             z-index: 1;
			}
			.lingdang{
				 width: 40px;
	            height: 40px;
	            border: 2px solid #000;
	            border-radius: 50px;
	            background: #d7cf14;
	            position: absolute;
	            top: 307px;
	            left: 438px;
	            z-index:1;
			}
			.body{
				position: relative;
                top: -310px;
			}
			.duzi{
				width: 220px;
	            height: 165px;
	            background: #0085a8;
	            border:2px solid #333;
	            position:absolute;
	            top:265px;
	            left:346px;
	            z-index: 0;
			}
			.dudou{
				width: 170px;
                height: 170px;
                background: #fff;
                border: 2px solid #000;
                border-radius: 85px;
                position: absolute;
                left: 370px;
                top: 230px;
                z-index: 0;
			}
			.koudai{
			    width: 130px;
                height: 130px;
                border-radius: 65px;
                background: #fff;
                border: 2px solid #000;
                position:absolute;
                top: 250px;
                left: 389px;	
			}
			.bankoudai{
				width: 134px;
                height: 60px;
                background:#fff;
                border-bottom: 2px solid #000;
                position:absolute;
                top: 259px;
                left: 389px;
			}
			.hand1{
				height: 100px;
                width: 100px;
                position: absolute;
                top: 317px;
                left: 294px;
			}
			.hand2{
				height: 100px;
                width: 100px;
                position: absolute;
                top: 317px;
                left: 559px;
			}
			.arm1{
				position: relative;
				width:80px;
                height:50px;
                background: #0085a8;
				top: 17px;
                transform: rotate(145deg);
                z-index: -1;
                border:1px solid #000;
			}
			.shou1{
				position: absolute;
				left: -20px;
                top: 37px;
				width: 60px;
                height: 60px;
                border-radius: 30px;
                border: 2px solid #000;
                background: #fff;
			}
			.arm2{
				position: relative;
				width:80px;
                height:50px;
                background: #0085a8;
				top: 17px;
                transform: rotate(-145deg);
                z-index: -1;
                border:1px solid #000;
			}
			.shou2{
				position: absolute;
				left: 34px;
                top: 37px;
				width: 60px;
                height: 60px;
                border-radius: 30px;
                border: 2px solid #000;
                background: #fff;
			}
			.foot{
                position: relative;
                top: 55px;
                left: 20px;
			}
			.foot .zuojiao{
				position: absolute;
				width: 125px;
                height: 30px;
                background: #fff;
                border: 2px solid #333;
                border-radius: 80px 60px 60px 40px;
				left: 304px;
                top: 65px;
			}
			.foot .youjiao{
				position: absolute;
				width: 125px;
                height: 30px;
                background: #fff;
                border: 2px solid #333;
                border-radius: 60px 80px 40px 60px;
				left: 440px;
                top: 65px;
			}
			.yuandian{
				width: 20px;
                height: 10px;
                background: #fff;
                border: 2px solid #000;   
                border-bottom: none;
                border-radius: 40px 40px 0 0;
                position: absolute;
                top: 57px;
                left: 425px;
			}
			.jiehe1{
				top: -45px;
                left: 346px;
				height: 45px;
                width: 5px;
                background: #0085a8;
                position: relative;
			}
			.jiehe2{
				top: -85px;
                left: 565px;
				height: 45px;
                width: 5px;
                background: #0085a8;
                position: relative;
			}
		</style>
	</head>
	<body>
		<!--头部-->
		<div class="tou">
			<div class="face"></div>
			<div class="eye1"></div>
			<div class="eye2"></div>
			<div class="blackeye1"></div>
			<div class="blackeye2"></div>
			<div class="nose"></div>
			<div class="mouth"></div>
			<div class="xian"></div>
			<div class="huxu huxu1"></div>
			<div class="huxu huxu2"></div>
			<div class="huxu huxu3"></div>
			<div class="huxu huxu4"></div>
			<div class="huxu huxu5"></div>
			<div class="huxu huxu6"></div>
		</div>
		<div class="weibo"></div>
		<div class="lingdang"></div>
		<div class="body">
			<div class="duzi"></div>
			<div class="dudou"></div>
			<div class="koudai"></div>
			<div class="bankoudai"></div>
		</div>
		<div class="hand1">
			<div class="arm1"></div>
			<div class="shou1"></div>
		</div>
		<div class="hand2">
			<div class="arm2"></div>
			<div class="shou2"></div>
		</div>
		<div class="foot">
			<div class="zuojiao"></div>
			<div class="youjiao"></div>
			<div class="yuandian"></div>
		</div>
		<div class="jiehe1"></div>
		<div class="jiehe2"></div>
	</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值