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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div id="container">
  <div class="step-wizard" role="navigation">
    <div class="progress">
      <div class="progressbar empty"></div>
      <div id="prog" class="progressbar"></div>
    </div>
    <ul>
      <li class="active">
        <button id="step1">
          <div class="step">1</div>
          <div class="title">Shipping Information</div>
        </button>
      </li>
      <li class="">
        <button id="step2">
          <div class="step">2</div>
          <div class="title">Billing Information</div>
        </button>
      </li>
      <li class="">
        <button id="step3">
          <div class="step">3</div>
          <div class="title">Payment Details</div>
        </button>
      </li>
      <li class="">
        <button id="step4">
          <div class="step">4</div>
          <div class="title">Review & Place Order</div>
        </button>
      </li>
    </ul>
  </div>
  <div class="buttons">
    <button class="btn" id="prev">prev</button>
    <button class="btn" id="next">next</button>
  </div>
</div>
              
            
!

CSS

              
                * {
  font-family: 'Arial', sans-serif;
}
#container {
  position: relative;
  text-align: center;
  max-width: 80%;
  box-sizing: border-box;
  margin: 0 auto;
}
.buttons {
  position: absolute;
  top: 180px;
  text-align: center;
  width: 100%;
}
.btn {
  width: 50px;
  height: 30px;
}
.step-wizard {
  display: inline-block;
  position: relative;
  width: 85%;
  .progress {
    position: absolute; 
    top: 35px;
    left: 12.5%;
    width: 75%;
  }
  .progressbar {
    position: absolute;
    background-color: #3B5343;
    opacity: 1;
    height: 3px;
    //border: 1px solid e5e6e6;
    width: 0%;
    -webkit-transition: width 0.6s ease;
    -o-transition: width 0.6s ease;
    transition: width 0.6s ease;
    &.empty {
      opacity: 1;
      width: 100%;
      background-color: #d0d0d0;
    }
  }
  ul {
    position: absolute;
    width: 100%;
    list-style-type: none;
    padding: 0;
    left: -2%
  }
  li {
    display: inline-block;
    text-align: center;
    width: 24%;
    & .step {
      text-align: center;
      display: inline-block;
      font-size: 18px;
      font-weight: bold;
      line-height: 30px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 3px solid;
      border-color: #d0d0d0;
      background: #ffffff;
      -webkit-transition: background-color 0.6s ease, border-color 0.6s ease;
      -o-transition: background-color 0.6s ease, border-color 0.6s ease;
      transition: background-color 0.6s ease, border-color 0.6s ease; 
    }
    & .title {
      text-decoration: underline;
      width: 100%;
      padding-top: 10px;
      color: #767676;
      -webkit-transition: color 0.6s ease;
      -o-transition: color 0.6s ease;
      transition: color 0.6s ease; 
    }
    &.active {
      .step {
        border-color: #3B5343;
        color: #3b5343;
      }
      .title {
        text-decoration: none;
        color: #3b5343;
        font-weight: bold;
      }
    }
    &.done .title {
      color: #3b5343;
      &:hover {
        color: #3B5343;
      }
    }
    &.done .step {
      color: white;
      background-color: #3B5343;
      border-color: #3B5343;
    }  
    & > button {
      background: none;
      border: none;
      display: block;
      width: 100%;
      color: #777;
      position: relative;
      text-align: center; 
      &:hover {
        & .step {
          border-color: #3b5343;
          background: #eee;
          color: #3b5343;
        }
        & .title {
          color: #3b5343;
        }
      }
    }
  } 
}

@media only screen and (max-width: 1200px) {
  .step-wizard li {
    width: 24%;
  }
}

@media only screen and (max-width: 375px) {
  .step-wizard li {
    width: 22%;
  }
}

li.done button div.step {
    font-size: 0;
}
li.done button div.step::before {
  content:  "\2713 ";
  font-size: 18px;
  
}
              
            
!

JS

              
                $(document).ready(function() {
  function setClasses(index, steps) {
    if (index < 0 || index > steps) return;
    if(index == 0) {
      $("#prev").prop('disabled', true);
    } else {
      $("#prev").prop('disabled', false);
    }
    if(index == steps) {
      $("#next").text('done');
    } else {
      $("#next").text('next');
    }
    $("ul li").each(function() {
      $(this).removeClass();
    });
    $("ul li:lt(" + index + ")").each(function() {
      $(this).addClass("done");
    });
    $("ul li:eq(" + index + ")").addClass("active")
    var p = index * (100 / steps);
    $("#prog").width(p + '%');
  }
  $(".step-wizard ul button").click(function() {
    var step = $(this).find("div.step")[0].innerText;   
    var steps = $(".step-wizard ul li").length;
    setClasses(step - 1, steps - 1)
  });
  $("#prev").click(function(){
    var step = $(".step-wizard ul li.active div.step")[0].innerText;
    var steps = $(".step-wizard ul li").length;    
    setClasses(step - 2, steps - 1);
  });
  $("#next").click(function(){
    if ($(this).text() == 'done') {
      alert("submit the form?!?")
    } else {
      var step = $(".step-wizard ul li.active div.step")[0].innerText;
      var steps = $(".step-wizard ul li").length;    
      setClasses(step, steps - 1);
    }
  });
  
  // initial state setup
  setClasses(0, $(".step-wizard ul li").length);
});
              
            
!
999px

Console