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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <!-- Gomez is the main character of the game Fez, an indie video game of a same name created by Polytron Corporation and published by Trapdoor. -->

<!-- 20 by 20 ? -->
<div class="container">
	
		<div class="hat">
			<div class="hat-shadow"></div>
			<div class="hat-tassel tassel1"></div>
			<div class="hat-tassel tassel2"></div>
		</div>
	
		<!-- Head 13 x 7 -->
		<div class="head">
			<div class="eye eye-left"></div>	
			<div class="eye eye-right"></div>
			<div class="headcorner ne"></div>
			<div class="headcorner se"></div>
			<div class="headcorner sw"></div>
			<div class="headcorner nw"></div>
			
			<!-- Shadowing -->
			<div class="light-shadow-side"></div>
			<div class="cover"></div>
			<div class="light-shadow-cheek"></div>
			<div class="shadow-nw"></div>
			<div class="dark-shadow-side"></div>
		</div>
	
		<div class="neck">
			<div class="neck-shadow light"></div>
			<div class="neck-shadow dark"></div>
		</div>
		<!-- Torso 6 x 6 -->
		<div class="torso">
			<div class="dark-shadow"></div>
			<div class="shadow-shoulder"></div>
			<div class="shadow-side"></div>
			<div class="shadow-bottom"></div>
		</div>
		<div class="arm-left">
			<div class="shadow"></div>	
		</div>
		<div class="hand-left">
			<div class="shadow"></div>	
		</div>	
		<div class="arm-right"></div>
		<div class="leg leg-right">
			<div class="cover"></div>
			<div class="shadow"></div>
		</div>
</div>
              
            
!

CSS

              
                :root {
	--background-color: #46c7ff;
	--hat-color: #dd0009;
	--hat-shadow: #a60108;
	--hat-tassel: #ffb425;
	--skin-color: #ffffff;
	--shadow-light: #e5edd6;
	--shadow-dark: #b9c8a7;
}

.container {
	width: 500px;
	height: 500px;
	position: absolute;
  top: 50%;
  left: 50%;
  margin: -250px 0 0 -250px;
	background-color: var(--background-color);
}

.hat {
	width: 15%;
	height: 15%;
	position: absolute;
	top: 5%;
	left: 30%;
	background-color: var(--hat-color);
}

.hat-shadow {
	width: 33%;
	height: 66%;
	position: absolute;
	bottom: 0;
	z-index: 2;
	background-color: var(--hat-shadow);
}

.hat-tassel { 
	width: 33%; 
	height: 33%;
	position: absolute;
	background-color: var(--hat-tassel);
}

.hat-tassel.tassel2 { left: -33%; top: 33%; }

.head {
	width: 65%;
	height: 35%;
	position: absolute;
	top: 20%;
	left: 15%;
	background-color: var(--skin-color);
}

.headcorner {
	width: calc(100%/13);
	height: calc(100%/7);
	background-color: var(--background-color);
	position: absolute;
	z-index: 3;
}

.headcorner.ne { top: 0; right: 0; }
.headcorner.se { bottom: 0; right: 0; }
.headcorner.sw { bottom: 0; left: 0; }
.headcorner.nw { top: 0; left: 0; }

.head .light-shadow-side {
	width: calc(100%/13 * 2);
	height: calc(100%/7 * 6);
	position: absolute;
	left: calc(100%/13);
	top: 0;
	background-color: var(--shadow-light);
	z-index: 2;
}

.head .cover {
	width: calc(100%/13);
	height: calc(100%/7 * 3);
	position: absolute;
	left: calc(100%/13 * 2);
	top: calc(100%/7 * 2);
	background-color: var(--skin-color);
	z-index: 4;
}

.head .light-shadow-cheek {
	width: calc(100%/13);
	height: calc(100%/7);
	position: absolute;
	left: calc(100%/13 * 3);
	bottom: 0;
	background-color: var(--shadow-light);
}

.head .shadow-nw {
	width: calc(100%/13);
	height: calc(100%/7);
	position: absolute;
	top: 0;
	left: calc(100%/13);
	background-color: var(--shadow-dark);
	z-index: 2;
}

.head .dark-shadow-side {
	width: calc(100%/13 * 3);
	height: calc(100%/7 * 6);
	position: absolute;
	bottom: 0;
	background-color: var(--shadow-dark);
	z-index: 1;
}

.eye {
	width: calc(100%/13);
	height: calc(100%/7);
	background-color: black;
	position: absolute;
	top: calc(100%/7 * 3);
}

.eye-left { left: calc(100%/13 * 3); }
.eye-right { right: calc(100%/13); }

.neck {
	width: 20%;
	height: 5%;
	background-color: var(--skin-color);
	position: absolute;
	top: 55%;
	left: 35%;
}

.neck-shadow {
	height: 100%;
	position: absolute;
}

.neck-shadow.dark {
	width: 50%;
	background-color: var(--shadow-dark);
}

.neck-shadow.light {
	left: 50%;
	width: 25%;
	background-color: var(--shadow-light);
}

.torso {
	width: 30%;
	height: 30%;
	position: absolute;
	top: 60%;
	left: 30%;
	background-color: var(--skin-color);
}

.torso .dark-shadow {
	width: calc(100%/6);
	height: calc(100%/6 * 8);
	position: absolute;
	background-color: var(--shadow-dark);
}

.torso .shadow-shoulder, .shadow-bottom {
	width: calc(100%/6);
	height: calc(100%/6);
	position: absolute;
	left: calc(100%/6);
	background-color: var(--shadow-light);
}

.torso .shadow-bottom {
	bottom: 0;
	left: calc(100%/6 * 2);
}

.torso .shadow-side {
	width: calc(100%/6);
	height: calc(100%/6 * 4);
	position: absolute;
	top: calc(100%/6 * 3);
	left: calc(100%/6);
	background-color: var(--shadow-light);
}

.arm-left, .hand-left {
	width: 10%;
	height: 5%;
	position: absolute;
	background-color: var(--skin-color);
}

.arm-left {
	top: 65%;
	left: 25%;
}

.hand-left {
	top: 70%;
	left: 20%;
}

.arm-left .shadow, .hand-left .shadow {
	height: 100%;
	width: 50%;
	position: absolute;
	background-color: var(--shadow-dark);
}

.arm-right {
	width: 5%;
	height: 5%;
	position: absolute;
	top: 70%;
	right: 35%;
	background-color: var(--shadow-dark);
}

.leg-right {
	width: 10%;
	height: 10%;
	position: absolute;
	bottom: 0%;
	right: 40%;
	background-color: var(--shadow-dark);
}

.leg-right .shadow, .leg-right .cover {
	width: 50%;
	height: 50%;
	position: absolute;
}

.leg-right .shadow {
	right: 0;
	top: 0;
	background-color: var(--shadow-light);
}

.leg-right .cover {
	background-color: var(--background-color);
	bottom: 0;
	left: 0;
}
              
            
!

JS

              
                
              
            
!
999px

Console