CSS画卡通人物:皮卡丘

皮卡丘

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Pikachu</title>
		<link rel="stylesheet" href="css/Pikachu.css" />
	</head>
	<body>
		 <div class="wrapper">
		 	<div class="nose"></div>
		 	<div class="eye left"></div>
		 	<div class="eye right"></div>
		 	<div class="face left"></div>
		 	<div class="face right"></div>
		 	<div class="lip left"></div>
		 	<div class="lip right"></div>
		 	<div class="lowerlip">
		 		<div class="mouth"></div>
		 	</div>
		 	
		 </div>
			
	</body>
</html>

*{
	margin: 0;
	padding:0;
	box-sizing: border-box;
}
*::after{
	box-sizing:border-box;
}
*::before{
	box-sizing:border-box;
}
body{
	height: 100vh;
	border:1px solid green;
	display: flex;
	justify-content: center;
    align-items:center;
    background-color:#FEE433;
}
.wrapper{
	width: 400px;
	height: 320px;
	position: absolute;
}
.nose{
	width: 0px;
	height:0px;
	border: 13px solid;
	border-radius: 50%;
	border-color:black transparent transparent;
	position: relative;
	left:50%;
	top: 25%;
	transform: translateX(-50%); 
}
.eye{
	width: 50px;
	height: 50px;
	border-radius:50% ;
	background-color: #2E2E2E;
	border: 5px solid black;
	float: left;
	position: absolute;
}
.eye::before{
	content: "";
	display:block;
	width: 20px;
	height: 20px;
	border-radius:50%;
	background-color:white ;
	transform: translateX(2px) translateY(-1px);
}
.eye.left{
	position: relative;
	left:25%;
	transform: translateX(-50%) translateY(50%);
}
.eye.right{
	position: relative;
	left:50%;
	transform: translateX(50%) translateY(50%);
}
.face{
	width: 80px;
	height: 80px;
	border:2px solid red;
	border-radius:50% ;
	background-color: #FC0D1C;
	position: absolute;
    top:0;
    left:0;

}
.face.left{
	position:relative;
	top:60%;
	left: 15%;
	 transform: translateX(-50%) translateY(-50%);
}
.face.right{
	position:relative;
	top:60%;
	left: 85%;
	transform: translateX(-50%) translateY(-150%);
}
.lip{
	width: 80px;
	height: 24px;
	border:4px solid black;
	background-color:#FEE433;
	z-index: 1;
	position:absolute;
	top:40%;
	left:50%;
}
.lip.left{
	border-bottom-left-radius:50% 100%;
	border-top:none ;
	border-right: none;
	transform: translateX(-100%) translateY(-7px) rotate(-30deg) translateX(2px);
	
}
.lip.right{
	border-bottom-right-radius:50% 100%;
	border-top:none;
	border-left: none;
	transform: translateX(-2px) translateY(-7px) rotate(30deg);
}
.mouth{
	width: 100px;
	height: 480px;
	border:1px solid red;
	border-radius: 50% ;
	background-color:#990513 ;
	position:absolute ;
	top: -30%;
	left: 50%;
	transform: translateX(-50%) translateY(-50%);
	position: absolute;
	overflow: hidden;
}
.lowerlip{
	width: 280px;
	height: 200px;
	position:absolute ;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-18%);
	overflow: hidden;
}
.mouth::after{
	content: " ";
	display: block;
	width:150px;
	height: 150px;
	border-radius:50% ;
	background-color:#FC4A62 ;
    position: relative;
    top: 90%;
    transform:  translateX(-25px) translateY(-65%);

}

 

  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然可以!下面是一个使用 CSS 绘制皮卡丘的示例: HTML 代码: ```html <div class="pikachu"> <div class="ear"></div> <div class="face"> <div class="eye"></div> <div class="eye"></div> <div class="mouth"></div> <div class="cheek"></div> </div> <div class="body"></div> <div class="tail"></div> </div> ``` CSS 代码: ```css .pikachu { width: 200px; height: 200px; background: #FDD835; position: relative; border-radius: 50%; overflow: hidden; } .ear { width: 60px; height: 120px; background: #FDD835; position: absolute; top: -40px; border-radius: 50%; } .face { width: 140px; height: 120px; background: #FDD835; position: absolute; top: 40px; left: 30px; border-radius: 50%; } .eye { width: 30px; height: 30px; background: #fff; position: absolute; top: 40px; } .eye:before { content: ""; width: 12px; height: 12px; background: #000; position: absolute; top: 9px; left: 9px; border-radius: 50%; } .mouth { width: 60px; height: 20px; background: #000; position: absolute; top: 70px; left: 40px; border-radius: 50%; } .cheek { width: 40px; height: 40px; background: #FF8F00; position: absolute; top: 60px; border-radius: 50%; } .body { width: 180px; height: 180px; background: #FDD835; position: absolute; top: 120px; left: 10px; border-radius: 50%; } .tail { width: 20px; height: 80px; background: #FDD835; : absolute; top: 180px; left: -10px; } ``` 你可以将上述代码复制到一个 HTML 文件中,然后在浏览器中打开该文件,就能看到绘制的皮卡丘了。希望这个示例对你有帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值