cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <html>
  
  <head>
  </head>
  
<body>
 <!-- Begin Image -->
 <!-- Invisible Box-->
 <div class="box">
   
    <!-- Circular Head-->
    <div class="head">       
      <!-- Circular Head Copy -->
      <div class="head-copy"></div>     
       <!-- Left Ear ~ Light Gray-->
      <div class="ear-left">       
         <!-- Inner ear ~ Dark Gray -->
        <div class="inner-ear"></div>
      </div>
      
      <!-- Right Ear ~ Light Gray-->
      <div class="ear-right">
      <!-- Inner Ear ~ Dark Gray-->
        <div class="inner-ear"></div>
      </div>
      
      <!-- Left Outer Eye ~ White -->
      <div class="eye-left">
        <!-- Pupil ~ Black -->
        <div class="pupil"></div>
      </div>
      
      <!-- Right Outer Eye ~ White -->
      <div class="eye-right">
        <!-- Pupil ~ Black -->
        <div class="pupil"></div>
      </div>
      
       <!-- Nose ~ Brown -->
       <div class="nose"></div>
      
       <!-- Hair ~ Light Gray -->
      <div class="hair-left"></div>
      <div class="hair-right"></div>
  
    </div><!-- End Head -->

 </div> <!-- End Invisible Box -->
  
  <div> <!-- for footer -->
      <h5><a href="http://www.eleftheriabatsou.com" target="_blank">Eleftheria </a> | <a href="https://codepen.io/EleftheriaBatsou" target="_blank">Projects</a> | <a href="https://www.youtube.com/channel/UCC-WwYv3DEW7Nkm_IP6VeQQ" target="_blank"> Coding videos </a></h5>
    </div> <!-- end footer -->
  
</body>

</html>
            
          
!
            
              body{
  background: #25A9FC; /*twitter-ish blue */
}

/* An invisible box will be centered horizontally due to the following code*/
.box{
  /* Position relative means the element is positioned relative to its normal position, which would be the very top left corner as it is the first div in the body. */
  
  /* When the position is set to relative, using display: block; and margin:auto; will automatically center the box horizontally. */
  position: relative;
  margin: auto;
  display: block;
  /*optional background or border*/
  border: solid 4px red;
  
  margin-top: 8%;
  width: 600px;
  height: 420px;
  background: none;
}

/* The width of the div is 50% and the height 67%. This means that the width is 50% of the box and the height 67% of the box. */
.head{
  position: absolute;
  top: 16.5%;
  left: 25%;
  width: 50%;
  height: 67%;
  background: #A6BECF; /* Light grey */
  border-radius: 50%; /* To make a circle */
}

/* The head copy is div is solely for the purpose of allowing the ears to appear behind the head. This is controlled by z-index. */
.head-copy{
  width: 100%;
  height: 100%;
  position: absolute;
  background: #A6BECF;
  border-radius: 50%;
  /* The higher the z-index value, the closer that div is to the top. */
  z-index: 2; 
}

/* We want both ears to be sticking out to the left and right of the head accordingly. Therefore, we use negative percentages, left: -20% and right: -20%. Meaning, each ear will shift 20% of the width of the head in the specified direction. */
.ear-left{
  position: absolute;
  width: 60%;
  height: 65%;
  left: -20%;
  top: 5%;
  background: #A6BECF;
  border-radius: 50%;
  z-index: 1;
}
.ear-right{
  position: absolute;
  width: 60%;
  height: 65%;
  right: -20%;
  top: 5%;
  background: #A6BECF;
  border-radius: 50%;
  z-index: 1;
}
.inner-ear{
  position: absolute;
  border-radius: 50%;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  background: #819CAF;
}


.eye-left{
  position: absolute;
  background: white;
  width: 30%;
  height: 33%;
  top: 25%;
  left: 21%;
  border-radius: 50%;
  z-index: 3;
}
.eye-right{
  position: absolute;
  background: white;
  width: 30%;
  height: 33%;
  top: 25%;
  right: 21%;
  border-radius: 50%;
  z-index: 2;
}
.pupil{
  position: absolute;
  width: 28%;
  height: 30%;
  top: 35%;
  left: 36%;
  border-radius: 50%;
  background: #27354A;
}

.nose{
  position: absolute;
  background: #BE845F;
  width: 25%;
  height: 42.5%;
  left: 37%;
  top: 45%;
  border-radius: 50px;
  z-index: 4;
}

/* Clip path is supported by Safari, Chrome, and Opera but not in Firefox. */
.hair-left{
  position: absolute;
  top: -8%;
  left: 30%;
  width: 20%;
  height: 20%;
  background:  #A6BECF;
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.hair-right{
  position: absolute;
  top: -4%;
  left: 48%;
  width: 20%;
  height: 20%;
  background:  #A6BECF;
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
            
          
!
999px
Loading ..................

Console