Step Progress bar, CSS Only - Kodhus

Step Progress bar, CSS Only

Today we will build a step progress bar, one of the useful components that is used usually in multi-step sign up forms and any use-case that needs a consecutive progressive flow to be shown to the user.

HTML structure

  <div class="container">
      <ul class="progressbar">
          <li class="active">login</li>
          <li>choose interest</li>
          <li>add friends</li>
          <li>View map</li>

As you can see, we have progressbar element as the main element which represents our progress bar.

Styling it

We will use Pseudo elements, :before and :after, and the + CSS selector to style our markup for our step progress bar. Since we have 4 steps, we set the width of each .progress bar li to be 100%/4 which is 25%. We use .progressbar li:before to create our step circles and .progressbar li:after for the lines between them. We have used counter-reset to add numbers in the circles. Take a look at the demo.

  .container {
      width: 600px;
      margin: 100px auto; 
  .progressbar {
      counter-reset: step;
  .progressbar li {
      list-style-type: none;
      width: 25%;
      float: left;
      font-size: 12px;
      position: relative;
      text-align: center;
      text-transform: uppercase;
      color: #7d7d7d;
  .progressbar li:before {
      width: 30px;
      height: 30px;
      content: counter(step);
      counter-increment: step;
      line-height: 30px;
      border: 2px solid #7d7d7d;
      display: block;
      text-align: center;
      margin: 0 auto 10px auto;
      border-radius: 50%;
      background-color: white;
  .progressbar li:after {
      width: 100%;
      height: 2px;
      content: '';
      position: absolute;
      background-color: #7d7d7d;
      top: 15px;
      left: -50%;
      z-index: -1;
  .progressbar li:first-child:after {
      content: none;
  .progressbar {
      color: green;
  .progressbar {
      border-color: #55b776;
  .progressbar + li:after {
      background-color: #55b776;

Share if you liked it: Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn