css布局实现万圣节南瓜人头效果代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现万圣节南瓜人头效果代码

代码标签: 万圣节 南瓜 人头 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        html, body {
          background: black;
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
        }
        
        .pumpkin {
          position: relative;
          z-index: 1;
          height: 13.4em;
          width: 17em;
          background: orange;
          border: 0.2em solid crimson;
          border-radius: 60%/120%;
          box-shadow: inset 0 0px 30px crimson;
          animation: float 2s infinite;
        }
        .pumpkin .decor {
          height: 12.6em;
          width: 6.5em;
          position: absolute;
          left: 5em;
          border-radius: 60%/100%;
          border-bottom: 0.4em solid crimson;
          border-top: 0.4em solid crimson;
          box-shadow: inset 0 0px 15px crimson;
          z-index: -1;
        }
        .pumpkin .decor:after {
          content: "";
          display: block;
          height: 13em;
          width: 14em;
          position: absolute;
          bottom: -0.7em;
          left: -3.5em;
          border-radius: 70%/100%;
          border-bottom: 0.4em solid crimson;
          border-top: 0.4em solid crimson;
          box-shadow: inset 0 0px 15px crimson;
        }
        .pumpkin .eye {
          margin-top: 3em;
          margin-left: 2em;
          width: 0;
          height: 0;
          border-style: solid;
          border-width: 0 35px 35px 35px;
          border-color: transparent transparent black transparent;
          transform: rotate(200deg);
        }
        .pumpkin .eye2 {
          margin-top: -2.2em;
          margin-left: 10em;
          width: 0;
          height: 0;
          border-style: solid;
          border-width: 0 35px 35px 35px;
          border-color: transparent transparent black transparent;
          transform: rotate(-200deg);
        }
        .pumpkin .mouth {
          width: 50px;
          height: 50px;
          background: black;
          margin-left: 4em;
          margin-top: -3.5em;
          border-radius: 20px 40px 30px 20px;
          transform: rotate(-90deg);
        }
        .pumpkin .mouth2 {
          width: 50px;
          height: 50px;
          background: black;
          margin-left: 6em;
          margin-top: 3em;
          border-radius: 20px 30px 30px 20px;
        }
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0