cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <h2>CSS: Responsive breadcrumb navigation</h2>
<i>A simple responsive breadcrumb navigation module using CSS (SCSS) only, without any framework dependencies. The state of the navigation is set by adding the class "active" or "completed" to each item. Use the classes "hide-mobile" and "show-mobile" to handle which parts that should be shown on the respective viewport sizes.</i>

<div class="container">
  <div class="breadcrumb">
    <a href="#" class="item completed">
      <span class="arrow"></span>
      <span class="hide-mobile">Your items</span>
      <span class="show-mobile">Items</span>
    </a>
    <a href="#" class="item active">
      <span class="arrow"></span>
      <span class="hide-mobile">Your details</span>
      <span class="show-mobile">Details</span>
    </a>
    <a href="#" class="item">
      <span class="arrow"></span>
      <span class="hide-mobile">Preview order</span>
      <span class="show-mobile">Preview</span>
    </a>
    <a href="#" class="item">
      <span class="hide-mobile">Send order</span>
      <span class="show-mobile">Send</span>
    </a>
  </div>
</div>
            
          
!
            
              $breakpoint-tablet: 991px;
$breakpoint-mobile: 767px;

body {
  background: #f2ffdd;
}

.container {
  margin-top: 25px;
}

.breadcrumb {
  width: 100%;
  min-width: 320px;
  display: inline-block;
  overflow: hidden;
  border-radius: 5px;
  counter-reset: flag; 
  font-family: arial;
  text-align: center;

  .item {
    position: relative;
    display: block;
    float: left;
    width: 25%;
    background: #E3E3E3;
    color: #3D3D3D;
    text-decoration: none;
    outline: none;
    font-size: 15px;
    font-weight: bold;
    line-height: 44px;
    white-space: nowrap;
    padding: 0 20px 0 60px;

    @media screen and (max-width: $breakpoint-tablet) {
      font-size: 13px;
    }

    @media screen and (max-width: $breakpoint-mobile) {
      line-height: normal;
      text-align: center;
      padding-bottom: 4px;
      padding-left: 0;
      padding-right: 0;

      &:not(.active) {
        padding-top: 2px;
        padding-bottom: 6px;
      }
    }
  }

  .item:first-child {
    border-radius: 5px 0 0 5px;

    &:before {
      left: 14px;

      @media screen and (max-width: $breakpoint-mobile) {
        left: 0;
      }
    }

    &:last-child {
      border-radius: 0 5px 5px 0;
    }
  }

  .arrow {
    position: absolute;
    top: 22px;
    right: 1px;
    z-index: 2;

    @media screen and (max-width: $breakpoint-mobile) {
      top: 24px;
    }
  }

  .arrow:after, .arrow:before {
    content: " ";
    position: absolute;
    height: 0;
    width: 0;
    border: solid transparent;
  }

  .arrow:after {
    border-color: rgba(136, 183, 213, 0);
    border-left-color: #E3E3E3;
    border-width: 20px;
    margin-top: -20px;

    @media screen and (max-width: $breakpoint-mobile) {
      margin-top: -23px;
      right: -12px;
      border-width: 23px 0 24px 12px;
    }
  }

  .arrow:before {
    border-color: rgba(194, 225, 245, 0);
    border-left-color: #fff;
    border-width: 23px;
    margin-top: -23px;

    @media screen and (max-width: $breakpoint-mobile) {
      margin-top: -28px;
      border-width: 28px 0 28px 15px;
    }
  }

  .item:before {
    content: counter(flag);
    counter-increment: flag;
    position: absolute;
    top: 0;
    left: 30px;
    width: 24px;
    height: 24px;
    border-radius: 100%;
    margin: 8px 0;
    background: white;
    box-shadow: 0 0 0 1px #ccc;
    font-size: 18px;
    font-weight: bold;
    color: #EB0A1E;
    line-height: 24px;

    @media screen and (max-width: $breakpoint-mobile) {
      position: relative;
      display: block;
      left: 0;
      width: 16px;
      height: 16px;
      line-height: 16px;
      font-size: 14px;
      margin: 6px auto 4px;
    }
  }

  .item:hover, .active{
    background: #fff;
  }

  .item:hover .arrow:after {
    border-left-color: #fff;
  }

  .active {
    border-top: 2px solid #09F;
    border-bottom: 2px solid #09F;
    line-height: 40px;

    @media screen and (max-width: $breakpoint-mobile) {
      line-height: normal;
    }

    &:before {
      color: #09F;
    }

    .arrow {
      top: 20px;

      @media screen and (max-width: $breakpoint-mobile) {
        top: 22px;
      }
    }

    .arrow:before {
      border-left-color: #09F;
    }

    .arrow:after {
      border-left-color: #fff;
    }

    &:first-child {
      border-left: 2px solid #09F;
    }

    &:last-child {
      border-right: 2px solid #09F;
    }
  }

  .item.completed {
    background: #444;
    color: #fff;

    .arrow:before, .arrow:after {
      border-left-color: #444;
    }

    &:after {
      box-shadow: 2px -2px 0 2px #444, 3px -3px 0 2px #444;
    }
  }
}

.hide-mobile {
  @media screen and (max-width: $breakpoint-mobile) {
    display: none;
  }
}

.show-mobile {
  display: none;

  @media screen and (max-width: $breakpoint-mobile) {
    display: inline-block;
  }
}

*, :after, :before {
  box-sizing: border-box;
}
            
          
!
999px
Loading ..................

Console