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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h3>CSS3 infinite loading bar</h3>
<div id="inner">
  <div class="impress"></div>
  <div class="container">
    <ul>
       <li> </li>
       <li> </li>
       <li> </li>
       <li> </li>
       <li> </li>
       <li> </li>
    </ul>
  </div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:700);

/*** set body ***/

body {
  background: #333;
  height: 100%;
  width: 100%;
}

/*** set title ***/
h3 {
  font-family: "Open sans";
  color: #fff;
  font-size: 200%;
  text-align: center;
  text-shadow: 2px 1px 6px #111;
}

div#inner {
  width: 220px;
  position: relative;
  margin: 0 auto;
}

div.impress{
  position: absolute;
  width: 220px;
  height: 40px;
  background: #4c4c4c;
  background: -moz-linear-gradient(top,  #4c4c4c 0%, #333333 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(100%,#333333));
  background: -webkit-linear-gradient(top,  #4c4c4c 0%,#333333 100%);
  background: -o-linear-gradient(top,  #4c4c4c 	0%,#333333 100%);
	background: -ms-linear-gradient(top,  #4c4c4c 	0%,#333333 100%);
	background: linear-gradient(to bottom,  #4c4c4c 0%,#333333 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#333333',GradientType=0 );
	box-shadow: inset 0 -2px 10px #222;
  border: 1px solid #222;
  opacity: 0.4;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
}

/*** set div as container ***/
div.container {
  position: relative;
  top: 11px; left: 11px;
  width: 200px;
  height: 20px;
  overflow: hidden;
  z-index: 10000;
  box-shadow: inset 0px 1px 3px #ddd;
}

div.container:before {
  position: absolute;
  content: " ";
  width: 100%;
  height: 50%;
  background-color: #fff;
  opacity: 0.2;
}

/*** start ul config ***/

ul {
  position: relative;
  width: 200%;
  height: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: -1;
}

/*** set li:first-child as our background  ***/

ul li:first-child {
   position: absolute;
   width: 100%;
   height: 100%;
   background-color: #aaaaaa;
   transform: none;
   -moz-transform: none;
   -webkit-transform: none;
}

/*** set other li's as loading bars ***/

ul li:nth-child(n+2) {
   position: relative;
   width: 7%;
   height: 100%;
   transform: skewX(-45deg);
   -moz-transform: skewX(-45deg);
   -webkit-transform: skewX(-45deg);
   background-color: #888;
   margin-right: 5%;
   display: inline-block;
   animation: loading 0.5s infinite linear;
   -moz-animation: loading 0.5s infinite linear;
   -webkit-animation: loading 0.5s infinite linear;
   -o-animation: loading 0.5s infinite linear;
}

/*** setup our animation ***/

@keyframes loading {
from {left:-10%;}
to {left:3%;}
}

@-moz-keyframes loading {
from {left:-10%;}
to {left:3%;}
}

@-webkit-keyframes loading {
from {left:-10%;}
to {left:3%;}
}

@-o-keyframes loading {
from {left:-10%;}
to {left:3%;}
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console