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

              
                <div>A div is a block element.</div>
<div>If we add another div, it goes below the first one.</div>
<a href="#">Links</a> <a href="#">are</a> <a href="#">inline</a> <a href="#">elements</a>. 
<br> <!-- the br tag allows us to go down one line from the previous inline element -->
<span>Span</span> <span>is</span> <span>also</span> <span>inline!</span>
<p>The p tag is also a block element. But below I'll show how you can change this!</p>
<div class="inline">This div has been made inline.</div>
<div class="inline">This div too!</div>
<p>Notice how the div no longer has a height or width!
  This is normal behavior. Inline elements take the width and height of the content inside.</p>
<p>Here are some span tags that have been made into block elements:</p>
<span class="block">Hey</span>
<p>If you don't set a width on a block element, it will span the full width of the page by default.</p>
<p>There is also <strong>inline-block</strong> which is kind of a mix of the two. It behaves like an inline element <em>except</em> you can add height and width properties.</p>
<p>Try it out yourself!</p>

              
            
!

CSS

              
                div {
  border:1px solid black;
  height:100px;
  width:200px;
}
span {
  border:1px solid black;
}
p {
  max-width:400px;
}

.inline {
  display:inline;
}
.block {
  display:block;
}
              
            
!

JS

              
                
              
            
!
999px

Console