css布局实现一个大脸兔效果代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现一个大脸兔效果代码

代码标签: 个大 脸兔 效果

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

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

<head>
  <meta charset="UTF-8">
<style>
    * {
  margin: 0;
  padding: 0;
}

body {
  background: lightcoral;
}

::-webkit-scrollbar {
  display: none;
}

.container {
  position: relative;
  margin: 0em auto;
  width: 400px;
  height: 400px;
  transform: scale(1.2);
  transform-origin: top;
}
.container > .rabbit {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.container > .rabbit > .tooth,
.container > .rabbit > .face,
.container > .rabbit > .nose,
.container > .rabbit > .earsP,
.container > .rabbit > .earsW {
  position: absolute;
  color: white;
  width: 60px;
  height: 60px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translatey(190px) rotate(180deg);
}
.container > .rabbit > .tooth:before, .container > .rabbit > .tooth:after,
.container > .rabbit > .face:before,
.container > .rabbit > .face:after,
.container > .rabbit > .nose:before,
.container > .rabbit > .nose:after,
.container > .rabbit > .earsP:before,
.container > .rabbit > .earsP:after,
.container > .rabbit > .earsW:before,
.container > .rabbit > .earsW:after {
  position: absolute;
  content: '';
  width: 60px;
  height: 90px;
  background: currentcolor;
  border-radius: 10em 10em 0 0;
  top: 50%;
  left: 50%;
}
.container > .rabbit > .tooth:before,
.container > .rabbit > .face:before,
.container > .rabbit > .nose:before,
.container > .rabbit > .earsP:before,
.container > .rabbit > .earsW:before {
  transform: translate(-50%, -50%) translate(-10.8px, 10.8px) rotate(-45deg);
}
.container > .rabbit > .tooth:after,
.container > .rabbit > .face:after,
.container > .rabbit > .nose:after,
.container > .rabbit > .earsP:after,
.container > .rabbit > .earsW:after {
  transform: translate(-50%, -50%) translate(10.8px, 10.8px) rotate(45deg);
}
.container > .rabbit > .face {
  color: #fff3f5;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%) translatey(100px) rotate(180deg);
}
.container > .rabbit > .face:before, .container > .rabbit > .face:after {
  width: 200px;
  height: 300px;
  background: currentcolor;
}
.container > .rabbit > .face:before {
  transform: translate(-50%, -50%) translate(-36px, 36px) rotate(-45deg);
}
.container > .rabbit > .face:after {
  transform: translate(-50%, -50%) translate(36px, 36px) rotate(45deg);
}
.container .........完整代码请登录后点击上方下载按钮下载查看

网友评论0