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

Untitled

A Pen By Captain Anonymous

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <div id="snoo">
  <div class="face">
    <div class="antenna"></div>
    <div class="eyes">
      <div class="lens left-lens">
        <div class="pupil"></div>
      </div>
      <div class="bridge"></div>
      <div class="lens right-lens">
        <div class="pupil"></div>
      </div>
    </div>
    <div class="smile"></div>
  </div>
	
	<div class="lower">
	  <div class="hands"></div>
	  <div class="feet"></div>
	  <div class="body">
      <div class="collar">
        <div class="neck"></div>
      </div>
  </div>
	</div>
</div>

            
          
!
            
              body {
  background: #CEE3F8;
}

/* Some basic styles */
#snoo {
	width: 300px;
	height: 380px;
	position: relative;
	margin: 0 auto;
}

/* The face is just an oval, so we'll apply border-radius to a rectangle */
#snoo .face {
	width: 182px;
	height: 115px;
	margin: 80px auto;
	position: relative;
	border: 9px solid black;
	background: white;
}

/* For the eyes, just two circles of orange red color will do */
#snoo .face .eyes {
	position: relative;
	width: 140px;
	height: 48px;
	margin: 20px auto;
}

#snoo .face .eyes .lens {
	width: 42px;
	height: 42px;
	background: white;
	content: '';
	position: relative;
	top: 0;
  border: 6px solid black;
	border-radius: 50%;
  display: inline-block;
}

#snoo .face .eyes .lens .pupil {
  width: 12px;
  height: 12px;
  background: orangeRed;
  content: '';
  position: absolute;
  bottom: 0;
  left: 11px;
  border: 4px solid black;
  border-radius: 50%;
}

#snoo .face .eyes .left-lens {
  float: left;
}
#snoo .face .eyes .right-lens {
  float: right;
  clear: all;
}

#snoo .face .eyes .bridge {
  position: absolute;
  width: 48px;
  height: 80px;
  border: 6px solid black;
  border-color: black transparent transparent transparent;
  border-radius: 150px / 120px;
  left: 40px;
  top: 20px;
}

/* Smile is just a border with some radius applied to it. pretty easy */
/* Now she's happy :) */

#snoo .face .smile {
	position: relative;
	margin: 0 auto;
	width: 36px;
	height: 14px;
	border: 6px solid black;
  top: -12px;
	/*border-radius: 150px / 120px;*/
  border-top-left-radius: 0 0;
  border-top-right-radius: 0 0;
  border-bottom-right-radius: 32px 32px;
  border-bottom-left-radius: 32px 32px;
}

/* For ears, we can use the pseudo elements of face div and position them correctly using absolute positioning. */
#snoo .face:after, #snoo .face:before {
	width: 32px;
	background: white;
	height: 32px;
	border: 8px solid black;
	content: '';
	position: absolute;
	top: 5px;
	border-radius: 50%;
	z-index: -1;
}

#snoo .face:after {left: -25px;}
#snoo .face:before {right: -25px;}

/* Antenna looks a bit hard at first look, but it's very easy to make */
/* See! a very perfect antenna for our snoo ;) */

#snoo .face .antenna {
	position: absolute;
	height: 50px;
	width: 44px;
	border: 9px solid black;
	left: 88px;
	top: -55px;
	transform: rotate(16deg);
	z-index: -1;
	border-color: black transparent transparent black;
	border-radius: 5px;
}

/* Here, we used the pseudo element for creating the circle on the antenna to keep out markup clean */
#snoo .face .antenna:after {
	content: '';
	position: absolute;
	top: -25px;
	right: -35px;
	width: 26px;
	background: white;
	height: 26px;
	border: 8px solid black;
	border-radius: 50%;
}

/* Now for the lower body part, we can  use just 3 divs to create everything from body to hands to feet. We'll use a lot of border-radius here and clever positioning using z-index */

/* First, we'll go with the body */
#snoo .lower .body {
	width: 88px;
	height: 178px;
	border: 9px solid black;
	margin: 0 auto;
	position: relative;
	top: -275px;
	border-radius: 120px / 250px;
	z-index: -1;
	background: #5882FA;
}

/* Let's do the neckline */
#snoo .lower .body .collar {
  position: absolute;
  top: 48px;
  left: 8px;
  width: 0;
  height: 0;
  border-left: 38px solid transparent;
  border-right: 38px solid transparent;
  border-top: 32px solid black; /*#406AE5;*/
  z-index: -1;
}

#snoo .lower .body .collar .neck {
  position: relative;
  top: -32px;
  left: -24px;
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-top: 32px solid white;
  z-index: 0;
}

/* Now, we'll do the hands */
#snoo .lower .hands {
	height: 78px;
	width: 134px;
	border: 9px solid black;
	position: relative;
	margin: 0 auto;
	top: -91px;
	border-radius: 43px;
	z-index: -1;
	background: #5882FA;
}

/* The shape of Snoo is now coming very well. We must take a note on the positioning of HTML elements so that styling them becomes easy */

/* For the feet, we'll do the same thing we did for hands */
#snoo .lower .feet {
	height: 16px;
	width: 128px;
	border: 8px solid black;
	position: relative;
	margin: 0 auto;
	top: -79px;
	border-radius: 24px 24px 0 0;
	z-index: -1;
	background: white;
}

/* So, it seems fine now. You can see how we can create cute creatures like these using just CSS3. Let's make sure if it works on every background color */
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console