Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrapper">
  <div class="body"></div>
  <div class="ear left"></div>
  <div class="ear right"></div>
  <div class="foot left">
    <div class="nails"></div>
  </div>
  <div class="foot right">
    <div class="nails"></div>  
  </div>
  <div class="head">
    <div class="eye left"></div>
    <div class="eye right"></div>
    <div class="trunk"></div>
    <div class="curves outside"></div>
    <div class="curves inside"></div>
    <div class="horns left">
    </div>
    <div class="horns right"></div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background-color: #ced1d6;
}

.wrapper {
  width: 250px;
  height: 250px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.body {
  width: 74%;
  height: 74%;
  background-color: #949dac;
  border-radius: 50%;
  margin: 25px auto 0;
  border: 2px solid #111;
}

.ear {
  width: 40%;
  height: 35%;
  background-color: #949dac;
  position: absolute;
  top: 40px;
  border: 2px solid #111;
  transform: rotate(-10deg);
  &.left {
    left: 10px;
    border-radius: 30% 20% 10% 50%;
    transform: rotate(-10deg);
    &:before {
      content: '';
      width: 90%;
      height: 80%;
      background-color: #ffaaab;
      border: 2px solid #111;
      position: absolute;
      top: 11px;
      left: 2px;
      border-radius: 30% 50% 10% 50%;
    }
  }
  &.right {
    right: 10px;
    border-radius: 20% 30% 50% 10%;
    transform: rotate(10deg);
    &:before {
      content: '';
      width: 90%;
      height: 80%;
      background-color: #ffaaab;
      border: 2px solid #111;
      position: absolute;
      top: 11px;
      right: 2px;
      border-radius: 50% 30% 50% 10%;
    }
  }
}

@keyframes stomp {
  0%,100% {
    bottom: 10px;
  }

  50% {
    bottom: 20px;
  }
}


@keyframes rstomp {
  0%,100% {
    bottom: 20px;
  }

  50% {
    bottom: 10px;
  }
}


.foot {
  width: 30%;
  height: 25%;
  background-color: #949dac;
  position: absolute;
  bottom: 10px;
  border: 2px solid #111;
  overflow: hidden;
  &.left {
    left: 45px;
    border-radius: 38% 50% 40% 35%;
    transform: rotate(3deg);
    animation: stomp .5s linear infinite;
  }
  &.right {
    right: 45px;
    border-radius: 50% 38% 35% 40%;
    transform: rotate(-3deg);
    animation: rstomp .5s linear infinite;
  }
}

.nails {
  width: 28%;
  height: 25%;
  background-color: #FFF;
  border: 2px solid #111;
  border-radius: 50% 50% 35% 35%;
  position: absolute;
  bottom: -2px;
  &:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #FFF;
    border: 2px solid #111;
    border-radius: 50% 50% 35% 35%;
    left: 180%;
    bottom: -2px;
  }
  &:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #FFF;
    border: 2px solid #111;
    border-radius: 50% 50% 35% 35%;
    left: 90%;
  }
}

.foot {
  &.left .nails {
    left: 5%;
  }
  &.right .nails {
    left: 10%;
  }
}

.head {
  width: 64%;
  height: 64%;
  background-color: #949dac;
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -32%;
  border-radius: 45% 45% 50% 50%;
  border: 2px solid #111;
}

.eye {
  width: 30px;
  height: 30px;
  background-color: #FFF;
  position: absolute;
  top: 55px;
  border: 2px solid #111;
  border-radius: 50%;
  &.left {
    left: 25%;
  }
  &.right {
    right: 25%;
  }
  &:before {
    content: '';
    width: 40%;
    height: 40%;
    background-color: #111;
    border-radius: 50%;
    position: absolute;
    bottom: 3px;
    left: 50%;
    margin-left: -20%;
  }
  &:after {
    content: '';
    width: 100%;
    height: 100%;
    background-color: #949dac;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #111;
    position: absolute;
    top: 22px;
    left: -2px;
  }
}

.trunk {
  &:before {
    content: '';
    width: 50px;
    height: 50px;
    background-color: #949dac;
    border-radius: 50%;
    border: 2px solid #111;
    position: absolute;
    bottom: -55px;
    left: 50%;
    margin-left: -34px;
  }
  &:after {
    content: '';
    width: 40px;
    height: 70px;
    box-sizing: border-box;
    background-color: #949dac;
    border: 2px solid #111;
    border-top: 0 solid transparent;
    border-bottom: 0 solid transparent;
    position: absolute;
    bottom: -30px;
    left: 50%;
    margin-left: -20px;
  }
}

.curves {
  &.outside {
    &:before {
      content: '';
      width: 10px;
      height: 10px;
      border: 2px solid transparent;
      border-right-color: #111;
      border-radius: 50%;
      position: absolute;
      bottom: 33px;
      left: 48px;
      transform: rotate(-30deg);
    }
    &:after {
      content: '';
      width: 10px;
      height: 10px;
      border: 2px solid transparent;
      border-left-color: #111;
      border-radius: 50%;
      position: absolute;
      bottom: 33px;
      right: 48px;
      transform: rotate(30deg);
    }
  }
  &.inside {
    width: 30px;
    height: 10px;
    border: 2px solid #111;
    box-sizing: border-box;
    border-color: #111 transparent transparent transparent;
    border-radius: 50%/10px 10px 0 0;
    position: absolute;
    bottom: 53px;
    left: 50%;
    margin-left: -15px;
    &:before {
      content: '';
      width: 24px;
      height: 8px;
      border: 2px solid #111;
      box-sizing: border-box;
      border-color: #111 transparent transparent transparent;
      border-radius: 50%/8px 8px 0 0;
      position: absolute;
      bottom: -20px;
      left: 50%;
      margin-left: -12px;
    }
    &:after {
      content: '';
      width: 20px;
      height: 6px;
      border: 2px solid #111;
      box-sizing: border-box;
      border-color: #111 transparent transparent transparent;
      border-radius: 50%/6px 6px 0 0;
      position: absolute;
      bottom: -40px;
      left: 50%;
      margin-left: -10px;
    }
  }
}

.horns {
  width: 0;
  height: 0;
  border-top: 30px solid #111;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  position: absolute;
  bottom: 0;
  &:before {
    content: '';
    width: 0;
    height: 0;
    border-top: 30px solid #FFF;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    position: absolute;
    bottom: 2px;
    transform: scale(0.7);
  }
  &.left {
    left: 30px;
    transform: rotate(25deg);
    &:before {
      left: -10px;
    }
  }
  &.right {
    right: 30px;
    transform: rotate(-25deg);
    &:before {
      right: -10px;
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console