Advertisement
Guest User

2D CSS ZOMBIE

a guest
Jul 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.48 KB | None | 0 0
  1. ### 2D ZOMBIE CSS DESIGN (THANKS CAPTAIN ANONYMOUS)
  2. <div class="container">
  3.   <div class="hair">
  4.     <div></div>
  5.     <div></div>
  6.     <div></div>
  7.     <div></div>
  8.     <div></div>
  9.   </div>
  10.   <div class="head">
  11.     <div class="scar"></div>
  12.     <div class="eye"></div>
  13.     <div class="mouth"></div>
  14.     <div class="bolt"></div>
  15.   </div>
  16. </div>
  17.  
  18. #### CSS
  19. .container,
  20. .head,
  21. .eye,
  22. .mouth,
  23. .hair,
  24. .scar,
  25. .bolt {
  26.   position: absolute;
  27. }
  28.  
  29. body {
  30.   background: #DDFFF7;
  31. }
  32.  
  33. .container {
  34.   margin: auto;
  35.   top: 0;
  36.   bottom: 0;
  37.   right: 0;
  38.   left: 0;
  39.   width: 200px;
  40.   height: 200px;
  41. }
  42.  
  43. .hair {
  44.   z-index: 50;
  45.   div {
  46.     position: absolute;
  47.     top: 30px;
  48.     left: 10px;
  49.     border-top: 30px solid #3B3F4B;
  50.     border-left: 15px solid transparent;
  51.     border-right: 15px solid transparent;
  52.   }
  53.   div:nth-child(2) {
  54.     left: 30px;
  55.   }
  56.   div:nth-child(3) {
  57.     left: 50px;
  58.   }
  59.   div:nth-child(4) {
  60.     left: 70px;
  61.   }
  62. }
  63.  
  64. .head {
  65.   width: 200px;
  66.   height: 200px;
  67.   background: #96C691;
  68.   border-radius: 20px 20px 100% 100%;
  69.   box-shadow: inset 0 40px 0 0 #3B3F4B;
  70. }
  71.  
  72. .scar {
  73.   top: 50px;
  74.   left: 120px;
  75.   width: 70px;
  76.   height: 8px;
  77.   background: #3B3F4B;
  78.   border-radius: 100px;
  79.   &:before,
  80.  &:after {
  81.    position: absolute;
  82.     content: '';
  83.   }
  84.   &:before {
  85.    top: -5px;
  86.     left: 20px;
  87.     width: 5px;
  88.     height: 20px;
  89.     background: #3B3F4B;
  90.     border-radius: 100px;
  91.   }
  92.   &:after {
  93.    top: -5px;
  94.     left: 50px;
  95.     width: 5px;
  96.     height: 20px;
  97.     background: #3B3F4B;
  98.     border-radius: 100px;
  99.   }
  100. }
  101.  
  102. .eye {
  103.   top: 80px;
  104.   left: 40px;
  105.   width: 30px;
  106.   height: 30px;
  107.   background: #FFF;
  108.   border-radius: 100%;
  109.   border: 4px solid #3B3F4B;
  110.   &:before {
  111.    position: absolute;
  112.     content: '';
  113.     top: -4px;
  114.     left: 83px;
  115.     width: 30px;
  116.     height: 30px;
  117.     background: #FFF;
  118.     border-radius: 100%;
  119.     border: 4px solid #3B3F4B;
  120.   }
  121. }
  122.  
  123. .mouth {
  124.   top: 130px;
  125.   left: 65px;
  126.   width: 80px;
  127.   height: 20px;
  128.   border-radius: 100px;
  129.   background: #3B3F4B;
  130. }
  131.  
  132. .bolt {
  133.   z-index: -1;
  134.   top: 140px;
  135.   left: 0;
  136.   width: 30px;
  137.   height: 10px;
  138.   background: #A2A5A4;
  139.   border: 5px solid #DDFFF7;
  140.   border-left: none;
  141.   box-shadow: -8px 0 0 #BDBEBE;
  142.   &:before {
  143.    position: absolute;
  144.     content: '';
  145.     top: -3px;
  146.     left: 162px;
  147.     width: 30px;
  148.     height: 10px;
  149.     background: #A2A5A4;
  150.     border: 5px solid #DDFFF7;
  151.     border-right: none;
  152.     box-shadow: 8px 0 0 #BDBEBE;
  153.   }
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement