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

              
                <h1>HTML Progress</h1>
<p>Demonstration of a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress">HTML Progress</a> element. There's a great write-up about styling <code>&lt;progress&gt;</code> on <a href="https://css-tricks.com/html5-progress-element/">CSS Tricks</a>.</p>
<p><label for="progressive">Are we there yet?</label>
  <progress id="progressive" max="100" value="50">50%</progress></p>
<p><label for="progressive-indeterminate">Where are we?</label>
  <progress id="progressive-indeterminate"></progress></p>
<p><label for="progressive-styled">Styled</label>
  <progress id="progressive-styled" 
    max="100"
    value="1"
    aria-valuemin="0" 
    aria-valuenow="1" 
    aria-valuemax="100" 
    role="progressbar" 
    tabindex="-1"></progress></p>
<p><button id="progress">Make Progress</button></p>
              
            
!

CSS

              
                // Common bits
body {
  padding: 1rem;
  font-size: 16px;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}

a {
  color: #039;
  
  &:hover,
  &:active,
  &:focus {
    color: #06c;
  }
}

label {
  display: block;
}

// less common bits
#progressive-styled {
  // kill embedded styles
  appearance: none;

  // write our own
  width: 20rem;
  height: 1rem;
  
  background-color: rgba(0, 0, 0, 0.4);
	// round the left/right edges
	// additional border around the value
	// looks like a slight blur at these sizes
	border: 0.1rem solid transparent;
  
  // deep into browser-specific code for this bit
  &::-webkit-progress-bar {
    background-color: transparent;
  }
  
  &::-webkit-progress-value {
			background-color: #000;
			// round the left/right edges
			transition: width 5s ease;
  }

  &::-moz-progress-bar {
			background-color: #000;
			transition: width 5s ease;
  }
}
              
            
!

JS

              
                document.getElementById("progress").addEventListener("click", (event) => {
  const progress = document.getElementById("progressive-styled");
  const newValue = progress.value + 1;
  progress.value = newValue;
  progress.setAttribute("aria-valuenow", newValue);
})
              
            
!
999px

Console