Pen Settings



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


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.



Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO


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.


Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:


Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO


                <div style="width:150px">
<div class="stepper" id="stepper_1">
  <div class="stepper-progress" style="transform: scaleX(0.6);"></div>
  <input type="text" class="stepper-number" min="10" max="90" value="50">

<div class="stepper" id="stepper_2">
  <div class="stepper-progress" style="transform: scaleX(0.6);"></div>
  <input type="text" class="stepper-number" min="0" max="500" value="0">
<div class="stepper" id="stepper_3">
  <div class="stepper-progress" style="transform: scaleX(0.6);"></div>
  <input type="text" class="stepper-number">


                * {
  -moz-box-sizing: border-box;
  box-sizing: border-box;

div {
  display: block;

.stepper {
  position: relative;
  width: 100%;
  height: 30px;
  background: #4e4e4e;
  border: 1px solid #292929;
  cursor: col-resize;

.stepper .stepper-number:focus {
  outline: 1px solid #1baee1;
  //cursor: text

.stepper-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  -webkit-transform-origin: 0 0;
  -ms-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transition: background-color 0.1s linear;
  transition: background-color 0.1s linear;

.stepper-number {
  position: relative;
  width: 100%;
  height: 28px;
  line-height: 28px;
  padding: 0 6px;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  outline-offset: 0;
  cursor: col-resize;
  z-index: 2;
} .stepper-progress {
  background-color: #1baee1;
} {
  background: rgba(255, 255, 255, 0.8)


                // jquery.stepper.js
// ------------------------------------------------------
// Author: NCOU
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
(function($, window, document, undefined) {

  "use strict";

  var pluginName = "stepper",
    defaults = {
      selectorProgressBar: '.stepper-progress',
      selectorInputNumber: '.stepper-number',
      classNameChanging: 'is-changing',
      decimals: 0,
      unit: '%',
      initialValue: '',
      min: 0,
      max: 100,
      stepSize: 1

  // The actual plugin constructor
  function Plugin(element, options) {
    this.element = element;

    this.settings = $.extend({}, defaults, options);

    this._defaults = defaults;
    this._name = pluginName;


  // Avoid Plugin.prototype conflicts
  $.extend(Plugin.prototype, {

    init: function() {

      // local variable
      this.curDown = false;
      this.mouseDownX = 0;
      this.mouseDownValue = 0;

      // Cache elements
      this.$el = $(this.element);
      this.$input = this.$el.find(this.settings.selectorInputNumber);
      this.$progress = this.$el.find(this.settings.selectorProgressBar);

      // init values
      this.min = this.$input.attr('min') || this.settings.min;
      this.max = this.$input.attr('max') || this.settings.max;

      this.initialValue = this.$input.val() || (this.settings.initialValue !== "" ? this.settings.initialValue : this.max);


      // Bind events
      this.$input.on('keydown', this.onKeyPress.bind(this));
      this.$input.on('blur', this.onBlur.bind(this));
      this.$input.on('paste input', this.onChange.bind(this));
      this.$el.on('mousedown touchstart', this.onMouseDown.bind(this));
      $(document).on('mouseup touchend', this.onMouseUp.bind(this));
      $(document).on('mousemove touchmove', this.onMouseMove.bind(this));

    onMouseDown: function(e) {
      this.mouseDownX = e.clientX || e.originalEvent.touches[0].clientX;
      this.mouseDownValue = this.getValue();


    onMouseUp: function(e) {

    onMouseMove: function(e) {
      if (this.curDown === true) {
        var t = (e.clientX || e.originalEvent.touches[0].clientX) - this.mouseDownX;
        this.setValue(this.mouseDownValue + t * this.settings.stepSize);

    onChange: function(e) {

    onBlur: function(e) {

    onKeyPress: function(e) {
      // key press == 'Enter' we exit the input field
      if (e.keyCode === 13) {

    getValue: function() {
      return parseFloat(this.$input.val()) || 0;

    setValue: function(amount) {
      var value;

      value = Math.max(Math.min(amount, this.max), this.min);
      value = this._roundValue(value);

      var n = value;
      n = n.toFixed(this.settings.decimals);

      n += this.settings.unit;


    _updateProgress: function(v) {
      var r = this._valueToPercent(v) / 100;
      this.$progress.css("transform", "scaleX(" + r + ")");


    _percentToValue: function(v) {
      return this.min + v / 100 * (this.max - this.min);

    _valueToPercent: function(v) {
      var t = (v - this.min) / (this.max - this.min) * 100;
      return Math.max(Math.min(t, 100), 0);

    _roundValue: function(v) {
      var nbrDecimals = 2;

      var t = Math.pow(10, nbrDecimals);
      return Math.round(v * t) / t

    _changeStart: function() {
      this.curDown = true;

    _changeEnd: function() {
      this.curDown = false;


  // A really lightweight plugin wrapper around the constructor,
  // preventing against multiple instantiations
  $.fn[pluginName] = function(options) {
    return this.each(function() {
      if (!$.data(this, "plugin-" + pluginName)) {
        $.data(this, "plugin-" + pluginName,
          new Plugin(this, options));

})(jQuery, window, document);

  unit: 's',
  initialValue: 0,
  min: 0,
  max: 300,
  stepSize: 1
The Pen is mightier than the sword.