div+css布局一个卡通小孩人物头部脸部效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局一个卡通小孩人物头部脸部效果代码

代码标签: div css 卡通 小孩 人物 头部 脸部

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 10px;
}

body {
  height: 100vh;
  background-color: #733a5d;
}

.container {
  display: flex;
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
}

.hair {
  width: 24rem;
  height: 12rem;
  background-color: #002337;
  border-top-left-radius: 5rem;
  border-bottom-right-radius: 5rem;
  position: relative;
  top: 4rem;
}
.hair__shadow {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  width: 10rem;
  height: 5rem;
  background-color: #333e50;
  border-top-left-radius: 2.5rem;
  border-bottom-right-radius: 2.5rem;
}
.hair::before, .hair::after {
  content: "";
  position: absolute;
  width: 1.5rem;
  background-color: #333e50;
}
.hair::before {
  top: 12rem;
  left: 0;
  height: 7rem;
  z-index: -10;
}
.hair::after {
  top: 7rem;
  right: 0;
  height: 12rem;
  z-index: -10;
}

.face {
  width: 21rem;
  height: 23.25rem;
  background-color: #f8c09d;
  border-radius: 0 0 50% 50%;
  position: relative;
  z-index: -10;
}

.eyebrows {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 5rem;
  display: flex;
  width: 15rem;
  justify-content: space-around;
}

.eyebrow {
  width: 4rem;
  height: 1.75rem;
  border-radius: 100vh;
  background-color: #002337;
  box-shadow: 0 1rem 0 0 #eb957c;
}

.eyes {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8.5rem;
  display: flex;
  width: 15rem;
  justify-content: space-around;
}

.eye {
  width: 2rem;
  height: 3.5rem;
  border-radius: 100vh;
  background-color: #002337;
}

.nose {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 13rem;
  display: flex;
  width: 5rem;
  j.........完整代码请登录后点击上方下载按钮下载查看

网友评论0