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="demo">
  <!-- menu -->
  <nav>
    <i class="fas fa-bars"></i>
    <i class="fas fa-caret-right"></i>
    Menu
  </nav>

  <!-- socials -->
  <i class="fab fa-facebook-square">
    <span class="sr-only">facebook</span>
  </i>
  <i class="fab fa-twitter">
    <span class="sr-only">twitter</span>
  </i>
  <i class="fab fa-instagram">
    <span class="sr-only">instagram</span>
  </i>

  <!-- secondary menu -->
  <a class="current">shop</a>
  <a>list</a>


  <!-- main content -->
  <h1>Code like no one's watching</h1>
  <h2>Edit like everyone is</h2>
  <p>There are many ways to start using a new feature in CSS without waiting for full cross-browser support, but “feature queries” are the most clear and explicit. We can use them to test for browser support, and provide targeted styles only where they are supported. Now we can do the same with new selectors, like ::marker or :focus-visible!</p>


  <!-- featured/action blocks -->
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/150150/placeholder.png">
  <p>Short Caption</p>
  <a href="">Sign Up</a>


  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/150150/placeholder.png">
  <p>Short Caption</p>
  <a href="">Log In</a>


  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/150150/placeholder.png">
  <p>Multi-line caption with more detail to convey before we display the important button.</p>
  <a href="">Add to Cart</a>


  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/150150/code.png">


  <!-- footer -->
  <footer>
    <p>Maybe a copyright or next section …</p>
  </footer>
</div>
              
            
!

CSS

              
                // Image for the headline effect
.code-bg {
  background-image: src('https://s3-us-west-2.amazonaws.com/s.cdpn.io/150150/code2.png');
}

// Colors you may need
.demo {
  --color-primary: hsl(258, 37%, 46%);
  --color-text: hsl(260, 14%, 29%);
  --color-border-light: hsl(0, 0%, 80%);
  --color-overlay: hsl(259, 36%, 28%);
  font-family: 'Fira Sans', sans-serif;
}


              
            
!

JS

              
                
              
            
!
999px

Console