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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                - list = [1, 2, 3, 4, 5, 6]
main.container
  .text-center
    h2.mb-4
      | CSS 
      code :nth-of-type()
    
  .d-flex.justify-content-center
    pre.code.
      .container {
        border: 4px solid pink;
      }
      .container .list-item:nth-child(odd) {
        background: blue;
      }

  .d-sm-flex.flex-row
    .col.col--half
      .nth-of-type-container
        p.mb-0
          code p
          small.ml-1
            b other element
            span.ml-2 child-1
        each item in list
          .list-item
            code div.list-item
            span.ml-2!= item
            small.ml-2= `child-${item + 1}`
      
    .col.col--half
      .nth-of-type-container
        div.mb-0
          code div
          small.ml-1 
            b same element!
            span.ml-2 child-1
        each item in list
          .list-item
            code div.list-item
            span.ml-2!= item
            small.ml-2= `child-${item + 1}`
              
            
!

CSS

              
                .nth-of-type-container
  border: 4px solid #e83e8c
  padding: .5em 1.5em
    
.nth-of-type-container
  .list-item:nth-of-type(odd)
    background-color: #baecfc
    
body
  padding: 2em 0
  background: #f4f4f4
  
main
  padding: 1em
  background: #fff
  max-width: 42em

.col
  padding: 0 1em 1em
 
small
  color: #999

.italic
  font-style: italic
  
.code
  color: #3b3f41
  background: #eee
  padding: .5em 1em
  border-radius: 2px  
    
@media(min-width: 576px)
  .col--half
    width: 50%
  
  .container
    min-width: 90%
    max-width: 46em
    
              
            
!

JS

              
                
              
            
!
999px

Console