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 class="container">
  <!-- Site Name and Navigation Bar -->
  <nav><h1>Site Name and Navigation Bar</h1></nav>
  <!-- Main Content -->
  <div class="main">
    <article>
      <h1>Main Content</h1>
      <p>The following <code>pre</code> element has text lines that wrap.</p>
      <h2>Code Example</h2>
      <!-- Code Example -->
      <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;meta name=&quot;description&quot; content=&quot;This is simply an demonstration of HTML (which stands for HyperText Markup Language) document markup.&quot;&gt;
    &lt;meta name=&quot;author&quot; content=&quot;SitePoint&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
  &lt;/head&gt;
&lt;/html&gt;</code></pre>
     </article>
  </div>
  <!-- Sidebar -->
  <div class="sidebar">
    <aside>
      <h1>Sidebar</h1>
      <p>This is the sidebar.</p>
      <!-- Some Useful Links -->
      <h2>Some Useful Links</h2>
      <nav>
      <ul>
        <li><a href="http://www.sitepoint.com/">SitePoint</a><li>
        <li><a href="http://reference.sitepoint.com/html/pre"><code>pre</code> - SitePoint Reference</a></li>
         <li><a href="http://reference.sitepoint.com/html/code"><code>code</code> - SitePoint Reference</a></li>
        <li><a href="http://www.w3.org/TR/html5/grouping-content.html#the-pre-element"> <code>pre</code> element W3C HTML5 specification</a></li>
        <li><a href="http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element"><code>code</code> element W3C HTML5 specification</a></li>
      </ul>
      </nav>
    </aside>
  </div>
</div>

<p class="p">Demo by Jacob Gube. <a href="http://www.sitepoint.com/everything-need-know-html-pre-element">See article</a>.</p>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab:700);
* { margin: 0; padding: 0; }

pre {
  white-space: pre-wrap;
  background-color: #ffffff;
  border: 1px solid #898989;
  padding: 5px;
}

nav {
  background: #e1e1e1;
}

.main {
  width: 60%;
  display: inline-block;
  float: left;
  background: #c2c2c2;
}

.sidebar {
  width: 35%;
  display: inline-block;
  float: right;
  background: #d7d7d7;
}

/* Basic Page Styles */
.container { width: 95%; max-width: 1000px; margin: 0 auto; }
.sidebar ul { list-style: none; padding-top:10px; }
.sidebar ul li { margin-bottom: 10px; }
nav, .main, .sidebar { padding: 5px; vertical-align: top; }
body { font: 14px/23px "Roboto", sans-serif; }
h1, h2 { font-family: 'Roboto Slab', serif; font-weight: 700; line-height: 1.8em; }
h1, h2, p, pre, ul { margin-bottom: 15px; }
h1 { font-size: 23px; }
h2 { font-size: 18px; color: #464646; }
@media only screen and (max-width: 640px) {
  nav, .main, .main article, .sidebar, .sidebar aside {
    width: 100%;
    display: block;
    float: none;
    padding: 0;
    padding-bottom: 10px;
  }
  h1, h2, p, ul, pre {
    margin-left: 15px;
    margin-right: 15px;
  }
}

.p {
  font-family: Arial, sans-erif;
  font-size: 14px;
  padding-top: 180px;
  clear: both;
  text-align: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console