Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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="container">
 
    <div id="head">
      <div class='white-space'></div>
      <div id='flower-big-container'>

        <div id='flower-container'>
          <div class='flower-element pink'></div>
           <div class='flower-element red'></div>
           <div class='flower-element pink'></div>
        </div>

        <div id='flower-middle'>
          <div class='flower-element middle'></div>
        </div>

       <div id='flower-container' class='down'>
          <div class='flower-element red'></div>
          <div class='flower-element pink'></div>
          <div class='flower-element red'></div>
        </div>

      </div>
      <div class="ear-container">
        <div class="ear ear-left"></div>
        <div class="ear ear-right"></div>
      </div>

      <div id="head-ball">
        <div id="face-container">
          <div class="face-element eye-left"></div>
          <div class="face-element nose"></div>
          <div class="face-element eye-right"></div>
        </div>
        <div id="whiskas-container">
          <div class="whiskas whiskas-left"></div>
          <div class="whiskas whiskas-right"></div>
        </div>
      </div>

    </div>
    <div id='body-container'>

      <div class='body'></div>
      <div class="hands">
        <div class="body-element hand-left"></div>
        <div class="item"></div>
        <div class="body-element hand-right"></div>
      </div>

       <div class="feet">
        <div class="body-element foot foot-left"></div>  
        <div class="body-element  foot foot-right"></div>
      </div>

    </div>
  
</div>
<div id='book-container'>
  <div id='book'>
    <div class='book-cover cover-top'>
      <div class='book-title'>
        <span>CSS</span>
       </div>
    </div>
    <div class='book-cover pages'>
      <p>hello css! <br/> :)</p>
    </div>
    <div class='book-cover cover-bottom'></div>
  </div>
</div>
              
            
!

CSS

              
                #book-container{
  position: absolute;
  z-index: 900;
  left: 220px;
  top: 220px;
  animation: shimmy 3s infinite;
  animation-direction: alternate;
}

#book{
  position: relative;
}
.book-cover{
  height: 80px;
  border: 0px solid;
  position: absolute;
  transform: rotate(-35deg);
  display: flex;
  flex-direction: row;
  
  &.cover-top{
   width: 65px;
   left: -7px;
   top: 100px;
   z-index: 2;
   background-color: darkgreen;
   border-radius: 5%;
   transition: all 1s;
    &:hover{ 
     width: 8px;
     left: 3px;
     top: 123px;
    }
    &:hover :nth-child(1) { 
      background-color: transparent;
      color: transparent; 
      border: 0;
    }
  }
  &.cover-bottom{
    border-radius: 5%;
    width: 64px;
    top: 110px;
    background-color: darkgreen;
    box-shadow: 1px 2px 2px grey;
  }
  &.pages{
    border-radius: 2%;
    width: 59px;
    left: 0px;
    top: 106px;
    background-color: beige;
    z-index: 1;
    :nth-child(1) { 
      margin-left: 10px;
      font-family: arial;
  }
  }
  
}
.book-title{
  width: 40px;
  height: 15px;
  border: 1mm ridge darkgreen;
  background-color: lightgreen;
  margin: 15px auto;
  text-align: center;
  padding: 2px;
  font-family: arial;
}


.container {
  width: 500px;
  height: 500px;
  border: 1px solid;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: lightgray;
  flex-direction: column;
}

#head {
  position: relative;
  z-index: 1;
   animation: shake 2s infinite;
  animation-direction: alternate;
  
  .white-space{
    position: absolute;
    background-color: white;
    z-index: 1;
    width: 36px;
    height: 35px;
    right: 17px;
    top: 88px;
  }
  
  #flower-big-container {
    position: absolute;
    border-radius: 100%;
    width: 50px;
    height: 55px;
    left: 20px;
    top: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 3s linear;  
    
    &:hover{
      transform: rotateZ(500deg);
      .flower-element{
      &.pink{
        background-color: green;
      }
      &.red{
        background-color: #1e90ff;
      }
    }
    }

    #flower-container {
      display: flex;
      justify-content: center;
      width:110%;
     
      &.down {
        transform: rotateX(180deg);
      }
    }

    #flower-middle {
      position: absolute;
      display: flex;
      justify-content: center;
      width: 100%;
    }
    .flower-element {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 1px solid black;
      
      &:nth-child(odd):not(.middle){
        margin-top: 10px;
      }
      
      &:nth-child(even){
        margin-bottom: 12px;
      }
      
      &.red{
        background-color: red;
      }
      &.pink{
        background-color:  #f9429e;
      }
      
      &.middle {
        background-color: yellow;
        width: 22px;
        height: 22px;
        z-index: 1;
      }
    }
  }

  .ear-container {
    width: 200px;
    position: absolute;
    display: flex;
    justify-content: space-between;
    top: 80px;

    .ear {
      width: 70px;
      height: 70px;
      border: 3px solid black;
      background-color: white;
      border-radius: 25% 100% 50% 100%;
      top: 80px;
      transform: rotate3d(0, 0, 1, 15deg);

      &-left {
        left: 150px;
      }

      &-right {
        right: 150px;
        transform: rotateY(180deg);
      }
    }
  }

  #head-ball {
    width: 200px;
    height: 160px;
    border: 3px solid black;
    border-radius: 90% / 100%;
    background-color: white;
    margin-top: 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;

    #face-container {
      width: 70%;
      margin: 0 auto;
      display: flex;
      justify-content: space-around;
      margin-top: 90px;
      .face-element {
        border: 2px solid black;
        width: 8px;
        height: 14px;
        border-radius: 45%;
        background-color: black;
        
        &.nose {
          margin-top: 18px;
          width: 9px;
          background-color: yellow;
          transform: rotateZ(90deg);
          transition: all 2s;
        }
        &.nose:hover{
          background-color: red;
        }
        &.eye-right:hover{
          transform:  scaleX(1.5) scaleY(0.2);
        }
         &.eye-left:hover{
          transform:  scaleX(1.5) scaleY(0.2);
        }
      }
    }

    #whiskas-container {
      width: 125%;
      margin-top: -26px;
      display: flex;
      justify-content: space-between;

      .whiskas {
        position: relative;
        
        &,
        &::after,
        &::before {
          width: 40px;
          height: 10px;
          border-top: 2px solid black;
          border-radius: 40% 40% 0 0;
        }

        &::after,
        &::before {
          width: 43px;
          content: "";
          position: absolute;
        }
        &::before {
          top: -18px;
          transform: rotate3d(0, 0, 1, 10deg);
        }

        &::after {
          top: 15px;
          transform: rotate3d(0, 0, 1, 8deg);
        }

        &-left {
          width: 45px;
        }

        &-right {
          width: 45px;
        }
      }
    }
  }
}

#body-container{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items:center; 
  flex-direction: column;
 
.body{
  margin-top: -10px;
  width: 68px;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 88px solid white;
  box-shadow: 0 2px 0 black;
  }
  .hands{
   width: 130px;
   display: flex;
   justify-content: space-between;
   position: absolute;
   top: -10px;
      animation: shimmy 3s infinite;
  animation-direction: alternate;
  }
 .feet{
  width: 178px;
  display: flex;
  justify-content: space-between;
  position: absolute;
  bottom: -10px;
  }

  .item{
    //border: 2px solid red; Work in progress
    width: 70px;
    height: 70px;
    position:absolute;
    z-index: 1;
  }
  
  .body-element {
    border: 2px solid black;
    width: 38px;
    height: 44px;
    border-radius: 45%;
    background-color: white;
    
    &.foot{
    width: 45px;
    height: 54px;
    }
    
  }
  
}
@keyframes shimmy {
  0% {
    transform: translate(0, 0);    
  }
  100% {
    transform: translate(-5px, -5px);
  }
}
@keyframes shake {
  0% {
    transform: skewY(1.5deg);
  }
  100% {
    transform: skewY(-1deg);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console