div+css布局实现卡通可爱狗头佩罗效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现卡通可爱狗头佩罗效果代码

代码标签: div css 布局 卡通 可爱 狗头 佩罗

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

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

<head>
  <meta charset="UTF-8">

  
  
  
<style>
:root {
  --background-color: #FF5733;
  --orange-fur-color: #ECB272;
}

body{
  background: var(--background-color);
}

.box-canvas{
  position: relative;
  margin: auto;
  display: block;
  margin-top: 8%;
  margin-bottom: 8%;
  width: 600px;
  height:600px;
  background: var(--background-color);
}

.ear {
  position: absolute;
  top: 10px;
  height: 220px;
  width: 140px;
  border-radius: 50% 50% 0 0;
  overflow: hidden;
  background: var(--background-color);
}

.left-ear {
  left: 120px;
  transform: rotate(-20deg);
}

.right-ear {
  right: 120px;
  transform: rotate(20deg);
}

.ear::before {
  content: '';
  position: absolute;
  top: -25px;
  background: var(--orange-fur-color);
  width: 130%;
  height: 120%;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.left-ear::before {
  left: -25px;
}

.right-ear::before {
  right: -25px;
}

.ear::after {
  content: '';
  bottom: 10px;
  position: absolute;
  background: pink;
  width: 95%;
  height: 80%;
  clip-path: polygon(49% 0, 6% 100%, 100% 100%);
}

.left-ear::after {
  right: 8px;
}

.right-ear::after {
  left: 5px;
}

.head {
  position: absolute;
  left: 150px;
  top: 150px;
  background: white;
  width: 300px;
  height: 275px;
  border-radius: 45%;
  overflow: hidden;
}

.head::before {
  content: '';
  position: absolute;
  left: 0;
  background: var(--orange-fur-color);
  width: 40%;
  height: 60%;
  border-radius: 0 0 50% 0;
}

.head::after {
  content: '';
  position: absolute;
  right: 0;
  background: var(--orange-fur-color);
  width: 40%;
  height: 60%;
  border-radius: 0 0 0 50%;
}
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0