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

              
                <ol class="progress-bar">
    <li class="progress-bar__step progress-bar__step--current progress-bar__step--step1">
        <span>Select Bill</span>
    </li>
    <li class="progress-bar__step progress-bar__step--step2">
        <span>Payment</span>
    </li>
    <li class="progress-bar__step progress-bar__step--step3">
        <span>Confirmation</span>
    </li>
</ol>
              
            
!

CSS

              
                /****************************************************************
Based on http://ericheikes.com/creating-a-progress-bar-with-css/
****************************************************************/

// Variables
$line_height: 20px;
$padding: 9px;
$arrow_size: ($line_height + 2 * $padding)/2;
$max_li: 10;

// Mixin
@mixin arrow() {
    position: absolute;
    top: 50%;
    content: " ";
    height: 0;
    width: 0;
    pointer-events: none;
}

.progress-bar {    
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Lucida Grande', sans-serif;
    font-size: 13px;
    line-height: $line_height;
    font-weight: bold;
    counter-reset: li;
    
    &__step {
        list-style-image: none;
        list-style-type: none;
        margin-left: 0;
        text-align: center;
        color: #3a3a3a;
        background: #dae4eb;
        position: relative;
        margin-left: 5px + 2 * $arrow_size;
        width: 33%;

        // Appended arrow.
        &:after {
            @include arrow();
            left: 100%;
            border: solid transparent;
            border-left-color: #dae4eb;
            border-width: $line_height;
            border-left-width: 10px;
            margin-top: -$arrow_size;
        }

        // No prepended arrow on first item.
        &:first-child {
            margin-left: 0;
            span {
                padding: $padding;
                &:after {
                    border: none;
                }
            }
        }

        // No appended arrow on last item.
        &:last-child {
            &:after {
                border-width: 0;
            }
        }

        span {
            display: block;
            padding: $padding ($padding + $arrow_size) $padding $padding;

            // Prepended arrow inset.
            &:after {
                @include arrow();
                right: 100%;
                border: solid #dae4eb;
                border-left-color: transparent;
                border-width: $line_height;
                border-left-width: 10px;
                margin-top: -$arrow_size;
            }

            // "X)" numbering
            &:before {
                content: counter(li) ") ";
                counter-increment: li;
            }
        }
    }
}
    
.progress-bar__step--current {
    color: #fff;
    background: #7b7b7b;

    // Appended arrow.
    &:after {
      border-left-color: #7b7b7b;
    }

    span {
        // Prepended arrow.
        &:after {
            border-color: #7b7b7b;
            border-left-color: transparent;
        }
    }
}

// For the overlapping to work, later LIs must have a lower z-index.
// @for $i from 1 through $max_li {
//     .progress-bar__step--step#{$i} {
//         z-index: $max_li - $i;
//     }
// }
              
            
!

JS

              
                
              
            
!
999px

Console