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

              
                <h3>Locally Generate a File and D<span></span>own<span></span>load it!</h3>
<button onclick="indexCfm()">Generate index.cfm file</button>
<button onclick="demoJs()">Generate demo.js file</button>

              
            
!

CSS

              
                
              
            
!

JS

              
                /****************************************************************
 got idea for automating the download from:
 https://gist.github.com/philipstanislaus/c7de1f43b52531001412
 
 page of some possible mime types:
 https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
 
 ****************************************************************/
function downloadFile(data, sFileName, sFileType) {
  let blob = new Blob([data], {type : sFileType});
  let sURL = URL.createObjectURL(blob);
  let a = document.createElement("a");
  
  document.body.appendChild(a);
  a.style = "display: none";
  a.href = sURL;
  a.download = sFileName;
  a.click();
  window.URL.revokeObjectURL(sURL);
} // end of function downloadFile()



function indexCfm() {
  let s=[];
  
  
  s.push("<cfset sDemo = 'Hello Word'>");
  s.push("<html>");
  s.push("<body>");
  s.push("<cfoutput>#sDemo#</cfoutput>")
  s.push("</body>");
  s.push("</html>");
  downloadFile(s.join("\n"), "index.cfm", "text/html")
  
} // end of function indexCfm()



function demoJs() {
  let s=[];
  
  
  s.push("function helloWorld() {");
  s.push("   let info = document.getElementById('info');");
  s.push("   info.innerHTML = 'Hello World!';");
  s.push("}")

  downloadFile(s.join("\n"), "demo.js", "text/javascript")
  
}
              
            
!
999px

Console