div+css布局实现卡通男生人物形象代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现卡通男生人物形象代码

代码标签: div css 布局 卡通 男生 人物 形象 代码

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

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

<head>
  <meta charset="UTF-8">
  
  
  
<style>
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

article {
  --skin: #fca;
  --skin-dark: #ea8;
  --skin-dark-semi: #ea84;
  --skin-light: #fec;
  --hair: #963;
  --hair-dark: #741;
  --hair-light: #b85;
  --shirt: #9cf;
  font-size: 0.66vmin;
  width: 90em;
  aspect-ratio: 1;
  position: relative;
  
  & *,
  & *::before,
  & *::after {
    position: absolute;
    box-sizing: border-box;
  }
}

.body {
  width: 100%;
  height: 40%;
  bottom: 0;
  
  .chest {
    bottom: 0;
    left: 50%;
    transform: translate(-50%);
    width: 90%;
    height: 73%;
    background: var(--skin);
    border-radius: 50% / 125% 125% 0 0;
    background: 
      radial-gradient(110% 120% at 50% 0, var(--skin) 12%, var(--skin-dark) 25%);
  }
  
  .shirt {
    bottom: 0;
    left: 50%;
    transform: translate(-50%);
    width: 91%;
    height: 74%;
    background: var(--shirt);
    border-radius: 50% / 125% 125% 0 0;
    mask: radial-gradient(80% 120% at 50% 0, #0000 20%, #000 0);
    
    &::before {
      content: "";
     .........完整代码请登录后点击上方下载按钮下载查看

网友评论0