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

              
                <template id="quote-template">
<p class="quote"></p>  -<cite class="author"></cite>
</template>
  
<div id="quotes"></div>

              
            
!

CSS

              
                
              
            
!

JS

              
                'use strict';
const quotes = [
  { quote: 'The greatest glory in living lies not in never falling, but in rising every time we fall.', author: 'Nelson Mandela' },
  { quote: 'The way to get started is to quit talking and begin doing.', author: 'Walt Disney' },
  { quote: 'Life is what happens when you\'re busy making other plans.', author: 'John Lennon' }
];

function appendQuotes(templateId) {
  const quoteList = document.getElementById('quotes');
  const fragment = document.getElementById(templateId);
  quoteList.innerHTML = '';
  
  quotes.forEach(quote => {
    const instance = document.importNode(fragment.content, true);
    instance.querySelector('.quote').innerHTML = '"'+quote.quote+'"';
    instance.querySelector('.author').innerHTML = quote.author;
    quoteList.appendChild(instance);
  });  
}
 
appendQuotes('quote-template');
              
            
!
999px

Console