div+css布局实现一个骷颅猫效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现一个骷颅猫效果代码

代码标签: 一个 骷颅 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">






    <style>
        body {
          height: 100vh;
          widht: 100vw;
          background: purple;
          justify-content: center;
          align-items: center;
          display: flex;
        }
        
        .cat { /* cat torso */
          position: relative;
          background: black;
          height: 15vmin;
          width: 10vmin;
          border-radius: 50%;
          display: flex;
          flex-wrap: wrap;
        }
        .cat::before { /* cat head */
          content: '';
          position: absolute;
          background: black;
          height: 10vmin;
          width: 10vmin;
          border-radius: 90%;
          left: 0vmin;
          top: -7vmin;
        }
        .cat::after { /* cat bottom */
          content: '';
          position: absolute;
          background: black;
          height: 12vmin;
          width: 14vmin;
          border-radius: 50%;
          top: 5vmin;
          left: 1vmin;
          transform: rotate(-8deg);
        }
        .ears {
          position: relative;
          height: 0;
          width: 0;
          top: -9.5vmin;
          left: -1vmin;
          transform: rotate(-18deg);
          border-left: 2vmin solid transparent;
          border-right: 3vmin solid transparent;
          border-bottom: 6vmin solid black;
        }
        .ears::after {
          content: '';
          position: absolute;
          height: 0;
          width: 0;
          top: 2.5vmin;
          left: 5.1vmin;
          transform: rotate(42deg);
          border-left: 2vmin solid transparent;
          border-right: 3vmin solid transparent;
          border-bottom: 6vmin solid black;
        }
        
        .eyes {
          position: relative;
          background: yellow;
          height: 3vmin;
          width: 3vmin;
          border-radius: 90% 90% 90% 50%;
          top: -4vmin;
          left: 1.1vmin;
        }
        .eyes::before {
          content: '';
          position: absolute;
          background: yellow;
          height: 3vmin;
          width: 3vmin;
          border-radius: 90% 90% 50% 90%;
          left: -5vmin;
        }
        .eyes::after {
          content: '';
          position: absolute;
          background: black;
          height: 2vmin;
          width: 1.5vmin;
          border-radius: 50%;
          top: 0.7vmin;
          left: 0.6vmin;
          box-shadow: -4.7vmin 0;
        }
        .bottom {
          position: relative;
          background: black;
          height: 11vmin;
          width: 3vmin;
          border-radius: 30%;
        }
        .bottom::before {
          content: '';
          position: absolute;
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0