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>
  <h1 id="title">Elephant</h1>
 <!-- Begin Image -->
 <!-- Invisible Box-->
 <div class="box">
   
    <!-- Circular Head-->
    <div class="head">   
      
      <!-- Circular Head Copy -->
      <div class="head-copy"></div>
      <div class="head-shine">
        <div class="head-shine-copy"></div>
      </div>
      
      
      <!-- For the eyebrows -->
      <div class="eyebrows-left">
        <div class="eyebrows-left-copy"></div>
      </div>
      <div class="eyebrows-right">
        <div class="eyebrows-right-copy"></div>
      </div>
      
      
      <!-- For the eyes -->
      <div class="eye-left">       
        <div class="eye-shine-big"></div>
        <div class="eye-shine-small"></div>
      </div>  
      <div class="eye-right">
        <div class="eye-shine-big"></div>
        <div class="eye-shine-small"></div>
      </div>
      
       
      <!-- Ears-->
       <div class="ear-left">       
         <!-- Inner ear ~ Dark Gray -->
        <div class="inner-ear"></div>
      </div>     
       <div class="ear-right">
      <!-- Inner Ear ~ Dark Gray-->
        <div class="inner-ear"></div>
      </div>
      
      
        <!-- Hair ~ Light Gray -->
      <div class="hair-left"></div>
      <div class="hair-middle"></div>
      <div class="hair-right"></div>
      
      <!-- nose and strikes -->
      <div class="nose"></div>
      <div class="nose-copy"></div>
      <div class="nose-round"></div>
      <div class="nose-strike-1"></div>
      <div class="nose-strike-2"></div>
      <div class="nose-strike-3"></div>
      <div class="nose-strike-4"></div>
      <div class="nose-strike-5"></div>

      
      
    </div><!-- End Head -->

 </div> <!-- End Invisible Box -->
  
  <div> <!-- for footer -->
    <h4><a href="https://youtu.be/zyk-SEVUk_w" target="_blank">Watch me code this image</a></h4>
      <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>
            
          
!
            
              $border-color: #37474F; /* the darkest grey */
$ears-color: #607D8B; /* dark grey */
$basic-color: #B0BEC5; /* grey */
$BG-color: #ECEFF1; /*light grey */
$eye-black-color: #000019; /* almost black */
$white-color: #EBFBFF; /* almost white */

body{
  background: $BG-color; /*light grey */
}

#title{
  text-align: center;
}

/* An invisible box will be centered horizontally due to the following code*/
.box{
  position: relative;
  margin: auto;
  display: block;
  /* optional background or border 
  border: solid 4px red;
  */
  margin-top: 1%;
  width: 600px;
  height: 450px;
  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: 14%;
  left: 21%;
  width: 55%;
  height: 70%;
  background: $basic-color; /* Light grey */
  border-radius: 50%; /* To make a circle */
  border: solid 6px $border-color;
}

/* 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{
  position: absolute;
  width: 100%;
  height: 100%;
  background: $basic-color;
  border-radius: 50%;
  z-index: 2; 
}

//the head is shiny!
.head-shine{
  top: 3.5%;
  left: 5%;
  width: 85%;
  height: 90%;
  position: absolute;
  background: $white-color;
  border-radius: 50%;
  z-index: 3; 
}
.head-shine-copy{
  top: 2.5%;
  left: 2.5%;
  width: 103%;
  height: 100%;
  position: absolute;
  background: $basic-color;
  border-radius: 50%;
  z-index: 4; 
}

//for the eyebrows
.eyebrows-left{
  position: absolute;
  background: $ears-color;
  width: 20%;
  height: 33%;
  top: 25%;
  left: 16%;
  border-radius: 50%;
  z-index: 3;
}
.eyebrows-left-copy{
  position: absolute;
  background: $basic-color;
  width: 115%;
  height: 100%;
  top: 10%;
  left: 3%;
  border-radius: 50%;
  z-index: 4;
}

.eyebrows-right{
  position: absolute;
  background: $ears-color;
  width: 20%;
  height: 33%;
  top: 25%;
  right: 16%;
  border-radius: 50%;
  z-index: 3;
}
.eyebrows-right-copy{
  position: absolute;
  background: $basic-color;
  width: 115%;
  height: 100%;
  top: 10%;
  right: 3%;
  border-radius: 50%;
  z-index: 4;
}

//eyes and pupils
.eye-left{
  position: absolute;
  background: $eye-black-color;
  border: solid 6px $white-color;
  width: 18%;
  height: 18%;
  top: 35%;
  left: 21%;
  border-radius: 50%;
  z-index: 3;
}
.eye-right{
  position: absolute;
  background: $eye-black-color;
  border: solid 6px $white-color;
  width: 18%;
  height: 18%;
  top: 35%;
  right: 21%;
  border-radius: 50%;
  z-index: 3;
}

.eye-shine-big{
  position: absolute;
  background: $white-color; 
  width: 23%;
  height: 23%;
  top: 10%;
  left: 9%;
  border-radius: 50%;
  z-index: 3;
}
.eye-shine-small{
  position: absolute;
  background: $white-color; 
  width: 15%;
  height: 15%;
  top: 5%;
  left: 43%;
  border-radius: 50%;
  z-index: 3;
}


.ear-left{
  position: absolute;
  top: 4%;
  left: -30%;
  width: 55%;
  height: 70%;
  background: $basic-color; //$basic-color; 
  border-radius: 50%; /* To make a circle */
  border: solid 6px $border-color;
}

//right ear is bigger than left!
.ear-right{
  position: absolute;
  top: 4%;
  right: -35%;
  width: 55%;
  height: 70%;
  background: $basic-color; //$basic-color; 
  border-radius: 50%; /* To make a circle */
  border: solid 6px $border-color;
}

/* sometimes inperfect makes it perfect */
.inner-ear{
  position: absolute;
  border-radius: 50%;
  width: 90%;
  height: 80%;
  top: 8%;
  left: 7%;
  background: $ears-color;
}

/* Clip path is supported by Safari, Chrome, and Opera but not in Firefox. */
.hair-left{
  position: absolute;
  top: -16%;
  left: 25%;
  width: 27%;
  height: 42%;
  background:  $border-color;
  border-radius: 50%;
  -webkit-clip-path: polygon(100% 0, 0% 100%, 100% 100%);
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}
.hair-middle{
  position: absolute;
  top: -14%;
  left: 31%;
  width: 27%;
  height: 42%;
  background:  $border-color;
  border-radius: 50%;
  -webkit-clip-path: polygon(100% 0, 0% 100%, 100% 100%);
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}
.hair-right{
  position: absolute;
  top: -11%;
  right: 32%;
  width: 27%;
  height: 42%;
  background:  $border-color;
  border-radius: 50%;
  -webkit-clip-path: polygon(100% 0, 0% 100%, 100% 100%);
clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

//nose, nose-copy and strikes in the nose
.nose{
  position: absolute;
  top: 60%;
  left: 45%;
  width: 85%;
  height: 60%;
  background: $basic-color; 
  border-radius: 45%; /* To make a circle */
  
  -webkit-clip-path: polygon(100% 28%, 100% 51%, 0 87%, 0 0);
clip-path: polygon(100% 28%, 100% 51%, 0 87%, 0 0);
  
  z-index: 4;
}
.nose-copy{
  position: absolute;
  top: 57%;
  left: 45%;
  width: 88%;
  height: 68%;
  background: $border-color; 
  border-radius: 45%; /* To make a circle */
  
  -webkit-clip-path: polygon(100% 28%, 100% 51%, 0 87%, 0 0);
clip-path: polygon(100% 28%, 100% 51%, 0 87%, 0 0);
  
  z-index: 3;
}

.nose-round{
  position: absolute;
  top: 75%;
  right: -40%;
  width: 21%;
  height: 18%;
  background: $border-color; 
  border-radius: 50%;
  z-index:4;
}

.nose-strike-1{
  position: absolute;
  top: 63%;
  left: 70%;
  width: 2%;
  height: 16%;
  background: $border-color; 
  border-radius: 50%;
  z-index:5;
}
.nose-strike-2{
  position: absolute;
  top: 64%;
  left: 73.5%;
  width: 2%;
  height: 14%;
  background: $border-color; 
  border-radius: 50%;
  z-index:5;
}
.nose-strike-3{
  position: absolute;
  top: 68%;
  left: 88.5%;
  width: 1.6%;
  height: 9%;
  background: $border-color; 
  border-radius: 50%;
  z-index:5;
}
.nose-strike-4{
  position: absolute;
  top: 68%;
  left: 91.5%;
  width: 1.7%;
  height: 11%;
  background: $border-color; 
  border-radius: 50%;
  z-index:5;
}
.nose-strike-5{
  position: absolute;
  top: 68%;
  left: 94.5%;
  width: 1.5%;
  height: 9%;
  background: $border-color; 
  border-radius: 50%;
  z-index:5;
}

            
          
!
999px
Loading ..................

Console