css+div实现弹簧狗狗效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div实现弹簧狗狗效果代码

代码标签: css div 弹簧 狗狗

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

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

 
<link href="https://fonts.googleapis.com/css?family=Space+Mono:400,400i,700,700i" rel="stylesheet">
<style>
    body {
  background: #81D2F6;
}

h1 {
  position: absolute;
  top: 20px;
  width: 99%;
  text-align: center;
  font-weight: normal;
  font-family: "Space Mono", monospace;
  font-size: 2rem;
}

.wrap {
  width: 520px;
  margin: 200px auto;
  position: relative;
  display: flex;
}

.front,
.rear,
.middle {
  position: relative;
}

.slink-connector {
  background-color: #CE7829;
  height: 100px;
  width: 70px;
  border-radius: 90px 20px 20px 90px;
  position: absolute;
  z-index: 2;
}

.leg {
  background-color: #832319;
  width: 15px;
  height: 90px;
  transform: rotate(-8deg);
  transform-origin: top left;
  position: absolute;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  bottom: -60px;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.mouth {
  position: absolute;
  background-color: #F8E896;
  width: 80px;
  height: 40px;
  right: -50px;
  top: 45px;
  border-radius: 100% 50%;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.mouth.top {
  transform-origin: left;
}
.mouth.top:after {
  position: absolute;
  content: "";
  width: 15px;
  height: 15px;
  right: -3px;
  border-radius: 50%;
  background-color: #000;
  z-inddex: 10;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.mouth.bottom {
  transform-origin: left;
}

.foot {
  background-color: #F8E896;
  width: 50px;
  height: 16px;
  position: absolute;
  z-index: 6;
  bottom: -5px;
  left: 0px;
  border-radius: 10px;
  transform: rotate(7deg);
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.foot:before {
  content: "";
  z-index: -1;
  background-color: #F8E896;
  width: 50px;
  height: 16px;
  position: absolute;
  z-index: 6;
  bottom: 0;
  left: -7px;
  border-radius: 10px;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.front {
  width: 30%;
}
.front .leg {
  z-index: 5;
}
.front .slink-connector {
  border-radius: 20px 90px 90px 20px;
  left: -13px;
}
.front .neck {
  background-color: #832319;
  width: 15px;
  height: 90px;
  position: absolute;
  top: -20px;
  left: 40px;
  z-index: 1;
  transform: rotate(50deg);
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.front .collar {
  background-color: #13321B;
  content: "";
  z-index: 7;
  width: 40px;
  height: 15px;
  position: absolute;
  top: 15px;
  left: 30px;
  transform: rotate(50deg);
  border-radius: 5px;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.front .head {
  background-color: #CE7829;
  position: absolute;
  height: 100px;
  width: 100px;
  border-radius: 50%;
  top: -80px;
  left: 66px;
  z-index: 3;
}
.front .head .eye {
  background-color: #fff;
  width: 20px;
  height: 35px;
  position: absolute;
  right: 4px;
  transform: rotate(-30deg);
  top: 10px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.front .head .eye:before {
  content: "";
  position: absolute;
  width: 10px;
  height: 13px;
  background-color: #000;
  border-radius: 50%;
  z-index: 5;
  bottom: 4px;
  right: 2px;
}
.front .head .eye:after {
  content: "";
  position: absolute;
  backgroun.........完整代码请登录后点击上方下载按钮下载查看

网友评论0