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

              
                <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />

<div class="container">
  <h1 class="text-center">Bootstrap step-bar</h1>
  <div class="row line">
      <div class="col-xs-4 stepText1">Step 1</div>
      <div class="col-xs-4 stepText2">Step 2</div>
      <div class="col-xs-4 stepText3">Step 3</div>
  </div>
  <div class="row">
      <div class="col-xs-4"><div class="step step1 active"></div></div>
      <div class="col-xs-4"><div class="step step2"></div></div>
      <div class="col-xs-4"><div class="step step3"></div></div>  
  </div> 
  <div class="autoCenter">
     <div id="prev">PREV STEP</div>
     <div id="next">NEXT STEP</div>
   </div>
</div>

 

              
            
!

CSS

              
                .line{
    border-bottom: 1px solid black;
    padding-bottom: 20px;
    width: 100%;
    left: 15px;
    position: relative;
}
.stepText1{
  text-align: left;
  left: -15px;
}
.stepText2{ text-align: center; }
.stepText3{
  text-align: right;
  right: -15px;
}
.step{
  width: 20px;
  height: 20px;
  border: 1px solid black;
  background: white;
  border-radius: 100px;
  margin-top: 30px;
  transition: 0.4s;
}
.step1{
  margin-top: -10px;
  float: left;
}
.step2{
  margin: 0 auto;
  margin-top: -10px;
}
.step3{
  float: right;
  margin-top: -10px;
}
.active{
  background: black;
}





/* not important */
body{
  font-weight: bold;
}
.autoCenter{
  margin: 50px auto;
  width: 345px;
  box-sizing: border-box;
}
#prev, #next{
  background: #333;
  color: white;
  padding: 10px 0;
  display: inline-block;
  width: 150px;
  text-align: center;
  margin: 10px;
cursor: pointer;
  transition: 0.3s;
}
#prev:hover, #next:hover{
  background: #1d1d1d;
}
              
            
!

JS

              
                $('document').ready(function(){
  var count = 0;
  $('.step').each(function(){
    count++;
   
  });
   
  var i = 0;
  //NEXT
  $('#next').on('click', function(){
    if(count > i +1 ){
        i++;
        $('.active').removeClass('active');
        $('.step').eq(i).addClass('active');
       }
  });
    //PREV
  $('#prev').on('click', function(){
   if(i > 0 ){
    i--;
    $('.active').removeClass('active');
    $('.step').eq(i).addClass('active');
   }
  });
});
              
            
!
999px

Console