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. 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

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

              
                <progress id="bp" class="progressbar barrajuego" value="8" max="10">
  <span>Progreso: <span class="pval">8</span>/10</strong></span>
</progress>
              
            
!

CSS

              
                /* ELIMINAMOS LOS ESTILOS DEPENDIENTES DE LA PLATAFORMA */

.progressbar {
  /* Eliminamos la apariencia nativa, para poder asignar estilos */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Copiado de normalize.css */
  vertical-align: baseline;
}

/* AÑADIMOS NUESTROS ESTILOS PERSONALIZADOS */

$grosor: 1em;
$longitud: 10em;
$color-fondo: skyblue;
$color-relleno: royalblue;

.barrajuego {
  /* Tamaño unificado */
  height: $grosor;
  width: $longitud;
}

@mixin barra-fondo() {
  background-color: $color-fondo;
  border-radius: $grosor/2;
}

@mixin barra-relleno() {
  background-color: $color-relleno;
  border-radius: $grosor/2;
}

/* Fondo de la barra en Chrome, Safari, Opera… */
.barrajuego::-webkit-progress-bar {
  @include barra-fondo();
}

/* Fondo de la barra en Firefox, IE, Egde… */
.barrajuego {
  @include barra-fondo();
  border: none; /* ¡Firefox añade un borde a la barra! */
}

/* Relleno de la barra en Chrome, Safari, Opera… */
.barrajuego::-webkit-progress-value {
  @include barra-relleno();
}

/* Relleno de la barra en Firefox, Waterfox, Tor Browser… */
.barrajuego::-moz-progress-bar {
  @include barra-relleno();
}

/* Relleno de la barra en IE y Egde */
.barrajuego::-ms-fill {
  @include barra-relleno();
  border: none; /* ¡Explorer añade un borde al relleno! */
}

/* ESTILOS PERSONALIZADOS PARA EL PROGRESS-POLYFILL (IE8-9) */
progress[role] {
  @include barra-fondo();
}

progress[role]:before {
  @include barra-relleno();
}

progress[role]:after {
  display: none;
}

progress[role] > span {
  display: none;
}


body {
  margin: 32px;
  text-align: center;
}

              
            
!

JS

              
                var bp = document.getElementById('bp');
setTimeout(tick, 1000);
function tick() {
  bp.value = bp.value % bp.max + 0.5;
  bp.querySelector('.pval').textContent = bp.value;
  setTimeout(tick, 1000);
}
              
            
!
999px

Console