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

              
                <header>
  <h1>This is my awesome title</h1>
</header>
<div id="main">
  <article>
    <h1>Main</h1>
    <p>Leave dead animals as gifts unwrap toilet paper<p>
    
    <p>Use lap as chair eat grass, throw it back up yet destroy the blinds but wake up human for food at 4am so meow my left donut is missing, as is my right, favor packaging over toy. The dog smells bad caticus cuteicus for claw drapes meow for human give me attention meow sit in box stare at ceiling. Find something else more interesting human give me attention meow. Eat from dog's food refuse to leave cardboard box. Scratch the furniture hide head under blanket so no one can see and sleep in the bathroom sink destroy couch as revenge scratch the furniture sweet beast, for have secret plans. Eat grass, throw it back up get video posted to internet for chasing red dot but eat and than sleep on your face. Sweet beast i like big cats and i can not lie, or loves cheeseburgers get video posted to internet for chasing red dot swat at dog, for cat slap dog in face but burrow under covers. Instantly break out into full speed gallop across the house for no reason the dog smells bad lick arm hair. Chase red laser dot lounge in doorway or under the bed. Kitty loves pigs hide head under blanket so no one can see. Swat at dog chase laser hiss at vacuum cleaner lounge in doorway behind the couch, or lick arm hair stretch. Sleep in the bathroom sink hopped up on catnip then cats take over the world for have secret plans vommit food and eat it again.</p>


  </article>
  <nav>
    <h1>Nav</h1>
  </nav>
  <aside>
    <h1>Sidebar</h1>
  </aside>
</div>
<footer>
  <h1>Footer content</h1>
</footer>
              
            
!

CSS

              
                body {
  padding: 2vw;
}

#main { 
  display: flex;
}

header, 
footer,
#main > article,
#main > nav,
#main > aside {
  border: 1px solid red;
  padding: 2vw;
}

#main > article { 
  order: 2; 
  min-width: 12em; 
  flex:1;
}
#main > nav { 
  order: 1; 
  width: 200px; 
}

#main > aside {
  order: 3; 
  width: 200px;
}

article p:first-of-type {
  font-size: 1.25em;
  font-style: italic;
}

@media all and (max-width: 800px) {
  /* 
    Too narrow to support three columns 
  */
  #main {
    flex-flow: column;
  }
  
  #main > article, 
  #main > nav, 
  #main > aside {
    /* Return them to document order */
    order: 0;
    padding: 5vw;
    width: auto;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console