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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <figure id="oymyakon">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/nastya.jpeg" alt>
<figcaption>Nastya, photographed by Sean Archer</figcaption>
</figure>
<div id="content">
<div>
<p>Located deep in Siberia, the village of Oymyakon holds the title of the coldest permanently inhabited place on Earth, tied with Verkhoyansk.

<p>From December to February, the weather in the tiny village (population 500) plummets to  -50°F (-45C), with a record low of -90°F (-68C) registered in 1933. At those temperatures, a naked human left outside would freeze to death in under a minute.

<p>The extreme conditions are partly due to the fact that the hamlet lies between two large ranges that trap arctic air between them; it is actually significantly warmer on the mountains than in the valley below.

<p>Surprisingly, summers in Oymyakon can be very mild, even hot; the town is also a growing tourist destination.
</div>
<div id="controls">
   <p>Hide captioned figure using:
<div>
   <button id="scale">transform scale 0</button>
   <button id="hidden">hidden attribute</button>
   <button id="overflow">height: 0; overflow: hidden</button>
   <button id="blurfilter">blur filter</button>
   <button id="reset">reset</button>
</div>
</div>
</div>
            
          
!
            
              body { 
    margin: 3rem;
    font-family: Avenir; 
    color: #fff; 
    background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/px.png);
    line-height: 1.4; 
    font-size: 1.1rem;
  }
h1 { font-weight: 100; }
	figure#oymyakon { 
    float: right; 
    width: 33%; 
    font-size: 0; 
  img { 
    width: 100%; 
    height: auto;
    box-shadow: 0 0 12px rgba(0,0,0,.3); }
   figcaption { 
     text-align: center; 
     font-size: 1rem; 
     font-style: italic;
     margin-top: 1rem; 
   }
  }
	p { margin-right: 2rem; }
div#controls { 
  margin: 2rem;
  p { font-style: italic; }
}
button { 
  font-size: 1.1rem;
  display: inline-block; 
  margin: .25rem .1rem ; }
div#content {
  display: flex;
  flex-direction: column;
}
@media all and (max-width: 800px) {
  figure#oymyakon { 
    float: none;
    margin: 0;
    width: 100%;
  }
  div#content {
    flex-direction: column-reverse;
  }
}
            
          
!
            
               var illustration = document.getElementById("oymyakon");
 var buttons = document.getElementsByTagName("button");
 
function clearButtons() {
			illustration.removeAttribute("style");	 
 }

scale.onclick = function() {
	illustration.removeAttribute("style");
	illustration.removeAttribute("hidden");	
	illustration.style.webkitTransform = "scale(0)";
	illustration.style.transform = "scale(0)";
}
hidden.onclick = function() {
	illustration.removeAttribute("style");
	illustration.setAttribute("hidden", "hidden");
}
overflow.onclick = function() {
	illustration.removeAttribute("style");
	illustration.removeAttribute("hidden");	
	illustration.style.height = "0";
	illustration.style.overflow = "hidden";
}
blurfilter.onclick = function() {
	illustration.removeAttribute("style");
	illustration.removeAttribute("hidden");	
	illustration.style.webkitFilter = "blur(200px)";
	illustration.style.filter = "blur(200px)";
}
reset.onclick = function() {
	illustration.removeAttribute("style");	 
	illustration.removeAttribute("hidden");	
}

            
          
!
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.

Console