Pen Settings



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


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


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.


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.


                <label class="file">
  <span class="file-label">Choose a file&hellip;</span>
  <input type="file">
  <span class="file-value" aria-hidden="true"></span>


                /* boilerplate stuff */

html {
  background-color: #f0f0f0;

body {
  color: #555;
  margin: 0 auto;
  max-width: 480px;
  padding: 1em;

/* style the "fake" input */

.js .file {
  background-color: #fff;
  background-image: linear-gradient(to bottom, #fff, #f1f1f1);
  border: 1px solid #ccc;
  border-bottom-color: #bbb;
  border-radius: 0.25em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
  display: block;
  line-height: 1;
  overflow: hidden;
  padding: 0.75em 2em 0.75em 0.75em;
  position: relative;
  text-align: center;

.js .file-label {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;

.js .file:hover {
  border-color: #aaa;
  border-bottom-color: #999

.js .file.focus {
  border-color: #709AD0;
  box-shadow: 0 0 0 1px #709AD0, 0 2px 0 1px #ddd;

.js .file.focus::after {
  border-top-color: #709AD0;

/* hide and overlay when JavaScript is enabled */

.js .file input,
.js .file input::-webkit-file-upload-button {
  cursor: pointer;

.js .file input {
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
  /* strange input behavior in IE */
  font-size: 10em;

/* show file value when selected */

.js .file-value {
  color: #709AD0;
  display: none;

.js .file-value::before {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIGhlaWdodD0iMTAwIiB3aWR0aD0iMTAwIj48cGF0aCBmaWxsPSIjNzA5QUQwIiBkPSJNMTQgMkg2Yy0xLjEgMC0yIC45LTIgMnYxNmMwIDEuMS45IDIgMiAyaDEyYzEuMSAwIDItLjkgMi0yVjhsLTYtNnptNC41IDdIMTNWMy41TDE4LjUgOXoiLz48L3N2Zz4NCg==);
  background-position: center;
  background-size: 100% auto;
  content: '';
  display: inline-block;
  height: 1.5em;
  line-height: 0;
  margin: -0.55em 0.25em -0.45em 0;
  position: relative;
  width: 1.5em;

.js .file-value {
  display: inline;


                // For each .file element
  // Save some elements as variables
  var $element = $(this);
  var $input = $element.find('input');
  var $value = $element.find('.file-value');
  // Bind event handlers to <input>
    // On change, update the visible elements
    change: function () {
      // Get the value of the input
      var val = $input.val();
      // Normalize strings
      val = val.replace(/\\/g, "/");
      // Remove the path
      val = val.substring(val.lastIndexOf("/") + 1);
      // Toggle the 'active' class based
      // on whether or not there is a value
      $element.toggleClass('active', !!val.length);
      // Set the value text accordingly
    // On focus, add the focus class
    focus: function () {
    // On blur, remove the focus class
    blur: function () {