Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div id="one">
  <p title="first paragraph">&nbsp;</p>
</div>

<div id="two">
  <p title="second paragraph">&nbsp;</p>
</div>

<div id="three">
  <p title="third paragraph">&nbsp;</p>
</div>

              
            
!

CSS

              
                *{
  box-sizing:border-box;
  padding:0;
  margin:0;
}
body{
  min-height: 200vh;
  /* only to create scrolling on the page */
}
div{
  width:400px;
  height:300px;
  padding:2rem;
}
p:before{
  content: attr(title);
}
#one{
  background-color: #bada55;
  height: 250px;
  width: 300%;
 
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1; 
  /*
  this accomplishes the same thing as adding
  position relative to the second and third div 
  */
}
#two{
  background-color: hsla(330, 50%, 50%, 0.5);
  height: 230px;
  /* position:relative; */
}
#three{
  background-color: salmon;
  /* position:relative; 
  try this on the 2nd or 3rd div to see the difference */
}
              
            
!

JS

              
                
              
            
!
999px

Console