纯css布局实现一个眼镜狗效果

代码语言:html

所属分类:布局界面

代码描述:纯css布局实现一个眼镜狗效果

代码标签: 实现 一个 眼镜 效果

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
  padding: 0;
  margin: 0;
  background: #eeeeee;
}

.container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.face-ear {
  height: 200px;
  width: 120px;
  background: #c7b198;
  border-radius: 50px 50px 60px 60px;
}

.face-ear:after, .face-ear:before {
  content: "";
  position: absolute;
  height: 0;
  width: 0;
  border-bottom: 60px solid #c7b198;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
}

.face-ear:before {
  left: -50px;
  top: 17px;
  transform: rotate(20deg);
}

.face-ear:after {
  right: -48px;
  top: 17px;
  transform: rotate(-20deg);
}

.nose-area {
  position: absolute;
  bottom: 0;
  height: 140px;
  width: 120px;
  background: #84a9ac;
  border-radius: 60px;
}

.nose-area:before {
  position: absolute;
  content: "";
  height: 62px;
  width: 18px;
  background: #84a9ac;
  left: 50%;
  transform: translate(-50%);
  top: -60px;
}

.nose {
  position: absolute;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: black;
  left: 50%;
  transform: translate(-50%);
  bottom: 80px;
  box-shadow: 34px -48px 0 -10px black, -33px -48px 0 -10px black;
}

.nose:before {
  content: "";
  position: absolute;
  height: 24px;
  width: 4px;
  background: black;
  left: 50%;
  transform: translate(-50%);
  bottom: -24px;
}

.nose:after {
  content: "";
  position: absolute;
  height: 4px;
  width: 30px;
  background: black;
  left: 50%;
  transform: translate(-50%);
  bottom: -28px;
}

.specs {
  position: absolute;
  height: 60px;
  width: 90px;
  background: transparent;
  border: 4px solid black;
  border-radius: 10px 10px 50px 50px;
  bottom: 100px;
  left: -50px;
}

.specs:before {
  content: "";
  position: absolute;
  height: 60px;
  width: 90px;
  background: transparent;
  border: 4px solid black;
  border-radius: 10px.........完整代码请登录后点击上方下载按钮下载查看

网友评论0