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>OSX-style Disk Usage <xmp>..using html5 <meter></xmp></h1>

<p>
  Macintosh HD <span class="free-space">64.54 GB free out of 120.47 GB</span></p>

<meter value="55.93" min="0" max="120.47" title="GB">
  <div class="meter-gauge">
    <span style="width: 46.42%;">Disk Usage - 55.93GB out of 120GB</span>
  </div>
</meter>  
  
<ul class="swatch">
  <li class="swatch__elem">Audio <span class="used-space">670.5 MB</span></li>
  <li class="swatch__elem">Movies <span class="used-space">10.1 GB</span></li>
  <li class="swatch__elem">Photos <span class="used-space">25.19 GB</span></li>
  <li class="swatch__elem">Apps <span class="used-space">19.31 GB</span></li>
  <li class="swatch__elem">Other <span class="used-space">660.5 MB</span></li>
</ul>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Roboto);

body {
  
  font-family: "Roboto", "Lucida Grande", "Lucida", sans-serif;
  margin: 5em auto;
  background: radial-gradient(#f9f9f9 20%, #ddd 80%);
  width: 550px;
}

h1 {
  
  font-size: 1.5em;
  margin: 0 auto 2.5em;
  font-weight: 700;
}

xmp {
  
  font-family: Consolas, Monaco, monospace;
  font-size: 85%;
  color: #666;
  font-weight: 400;
}

meter {
  
  display: block;
  margin: 0 auto;
  
  width: 550px;
  height: 25px;
  
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;

  border: 1px solid #ccc;
  border-radius: 3px;
  
  /* Firefox */
  background: none; /* Required to get rid of the default background prop. */
  background-color: whiteSmoke;  
  box-shadow: 0 5px 5px -5px #333 inset;
}

meter::-webkit-meter-bar {
  
  background: none; /* Important to get rid of default background. */
  background-color: whiteSmoke;
  
  box-shadow: 0 5px 5px -5px #333 inset;
}

meter::-webkit-meter-optimum-value {
  
  transition: width .5s;
  box-shadow: 0 5px 5px -5px #999 inset;
  
  background-image: linear-gradient( 90deg, 
                                     #8bcf69 5%, 
                                     #e6d450 5%,
                                     #e6d450 15%,
                                     #f28f68 15%,
                                     #f28f68 55%,
                                     #cf82bf 55%,
                                     #cf82bf 95%,
                                     #719fd1 95%,
                                     #719fd1 100%);
  
  background-size: 100% 100%;
}

meter::-webkit-meter-optimum-value:hover {
  
  background-image: linear-gradient( 90deg, 
                                     #8bcf69 20%, 
                                     #e6d450 20%,
                                     #e6d450 40%,
                                     #f28f68 40%,
                                     #f28f68 60%,
                                     #cf82bf 60%,
                                     #cf82bf 80%,
                                     #719fd1 80%,
                                     #719fd1 100%);
  
  transition: width .5s;
  width: 100% !important; /* !important keyword used to override the inline style in ebkit browsers. */
}

meter::-moz-meter-bar {
  
  box-shadow: 0 5px 5px -5px #999 inset;
  
  background-image: linear-gradient( 90deg, 
                                     #8bcf69 5%, 
                                     #e6d450 5%,
                                     #e6d450 15%,
                                     #f28f68 15%,
                                     #f28f68 55%,
                                     #cf82bf 55%,
                                     #cf82bf 95%,
                                     #719fd1 95%,
                                     #719fd1 100%);
  
  background-size: 100% 100%;
}

p {
 
  margin: 0 auto ;
  width: 550px;
  line-height: 2.5;
}

.free-space {
  
  float: right;
}

.swatch {
  
  margin: 0; padding:0;
  margin: 5em auto;
  list-style-type: none;
  width: 550px;
  display: block;
  position: relative;
}

.swatch::before {
  
  content: '';
  width: 100%;
  height: 10px;
  outline: 0px solid #000;
  position: absolute;
  top: -20px;
  left: 0;
  border-radius: 2px;
  
  background-image: linear-gradient( 90deg, 
                                     #8bcf69 20%, 
                                     #e6d450 20%,
                                     #e6d450 40%,
                                     #f28f68 40%,
                                     #f28f68 60%,
                                     #cf82bf 60%,
                                     #cf82bf 80%,
                                     #719fd1 80%,
                                     #719fd1 100%);

}

.swatch__elem {
  
  outline: 0px solid #c00;
  float: left;
  width: 110px;
  padding-left: 5px;

  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

.used-space {
  
  display: block;
  line-height: 2;
  font-size: 85%;
  color: #666;
}

.meter-gauge {

    border: 1px solid #ccc;
    border-radius: 3px;

    background-color: whiteSmoke;
    box-shadow: 0 5px 5px -5px #333 inset;

    width: 550px;
    height: 25px;
    
    display: block;
}
  
.meter-gauge > span {
 
  height: inherit;  
  box-shadow: 0 5px 5px -5px #999 inset;
  
  background-color: blue;
  background-image: linear-gradient( 90deg, 
                                     #8bcf69 5%, 
                                     #e6d450 5%,
                                     #e6d450 15%,
                                     #f28f68 15%,
                                     #f28f68 55%,
                                     #cf82bf 55%,
                                     #cf82bf 95%,
                                     #719fd1 95%,
                                     #719fd1 100%);
  
  background-size: 100% 100%;

  display: block;
  text-indent: -9999px;
}
              
            
!

JS

              
                
              
            
!
999px

Console