Pen Settings



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


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


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.


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.


                <div class="wrap">
<main class="main-content">
  <p class="title">this is the main area</p>
  <div class="hoverable">this is an element you hover over...<div class="hoverable popup">... to make this element appear<div class="popup">oh and this one too</div></div></div>
<aside class="sidebar">
  <p class="title">this is a sidebar</p>
  <div class="sidebar-element">this is an element inside the sidebar.</div>


                .wrap {
  font-size: 2rem;
  display: flex;

.title {
  font-size: 1.2em;
  margin-bottom: 60px;

.main-content {
  width: 70%;
  background-color: palegreen;
  padding: 40px 20px 200px;
  z-index: 1; /* this z-index creates a stacking context for all main's children */

div {
  padding: 20px 20px 60px;

.hoverable {
  width: 60%;
  background-color: #cfc;
  border: 3px dashed darkgreen;  
  position: relative;

.popup {
  width: 80%;
  background-color: #dfd;
  border: 3px dashed darkgreen;
  display: none;
  position: absolute;
  left: 75%;
  z-index: 10000000000; /* This won't work!*/

.hoverable:hover > .popup {
  display: block;

.sidebar {
  width: 30%;
  background-color: cornsilk;
  padding: 40px 0 200px;
  z-index: 2;

.sidebar .title {
  margin-left: 20px;

.sidebar-element {
  background-color: blanchedalmond;
  border: 3px dashed indianred;
  padding-bottom: 200px;
  position: relative;
  z-index: 3; /* this z-index is higher than main's so everything inside main will go under this element */

/* NOTE: in this particular case, the whole thing would work fine with no z-indices at all. The popup would still go over the sidebar because positioned elements are higher in the stacking order than non-positioned elements. (position:relative would also have to be removed from the sidebar element for this to work) */