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

              
                <nav class="breadcrumb">
  <h2 id="breadcrumblabel" class="invisible">You are here:</h2>
  <ol aria-labelledby="breadcrumblabel" itemscope itemtype="http://schema.org/BreadcrumbList" id="breadcrumbList">
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" id="home">
      <a href="/" itemprop="item">Homepage</a>
      <meta itemprop="position" content="1" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg>      
    </li>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <a href="/clothing/" itemprop="item">Clothing</a>
      <meta itemprop="position" content="2" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg> 
    </li>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <a href="/clothing/mens/" itemprop="item">Men's clothing</a>
      <meta itemprop="position" content="3" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg> 
    </li>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <a href="/clothing/mens/shoes/" itemprop="item">Shoes &amp; footwear</a>
      <meta itemprop="position" content="4" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg> 
    </li>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <a href="/clothing/mens/shoes/leather/" itemprop="item">Leather</a>
      <meta itemprop="position" content="5" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg> 
    </li>    
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <a href="/clothing/mens/shoes/leather/boots/" itemprop="item" rel="prev">Boots</a>
      <meta itemprop="position" content="6" />
      <svg class="arrow" aria-hidden="true"><use xlink:href="#arrow"></use></svg> 
    </li>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      <strong title="current page" itemprop="item" aria-current="location">Cowboy boots</strong>
      <meta itemprop="position" content="7" />
    </li>
  </ol>
</nav>

<svg class="svg-sprite" aria-hidden="true" id="arrow" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M 64.00,416.00l 96.00,96.00l 256.00-256.00L 160.00,0.00L 64.00,96.00l 160.00,160.00L 64.00,416.00z"/></svg>  
              
            
!

CSS

              
                body {
  font-family: Arial, sans-serif;
  font-size: 100%;
}

a {
  display: block;
  padding: 5px 0;
  color: #000000;
  outline: none;
  text-decoration: none;
}
a:hover, a:focus, a:active {
  padding-bottom: 3px;
  outline: 1px solid transparent;
  border-bottom: 2px solid #000000;
}

button::-moz-focus-inner {
  border: 0;
}

button {
  box-sizing: border-box;
  font-size: 0.75rem;
  font-weight: bold;
  margin: 0 0.375rem 0 0;
  width: 1.75rem;
  height: 1.25rem;
  cursor: pointer;
  outline: none;
  border-radius: 4px;
  border: none;
  box-shadow: 0px 0px 1px 0px rgba(0,0,0,0.75);
  background-color: #efefef;
}

button:hover,
button:focus,
button:active {
  outline: 1px solid transparent;
  box-shadow: 0px 0px 1px 1px rgba(0,0,0,0.75);
}

.svg-sprite {
  position: absolute;;
  top: -999999px;
  left: -999999px;
  z-index: -1;
  overflow: hidden;
}

.arrow {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.25rem 0 0.25rem;
  fill: #000000;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.75rem;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  display: flex;
  justify-content: center; 
  align-items: center;
  flex-wrap: nowrap; 
  list-style-type: none;
  max-width: 100%;
}

html.js .breadcrumb li {
  z-index: -1;
  max-width: 0;
  visibility: hidden;
  transition: max-width 0.25s ease,  visibility 0.25s ease;
}
html.js .breadcrumb .js-expanded li {
  display: flex;
  max-width: 100%;
  visibility: visible;
  z-index: 0;
}


html.js .breadcrumb li:first-of-type,
html.js .breadcrumb li:nth-last-of-type(-n+3) {
  display: flex;
  max-width: 100%;
  visibility: visible;
  z-index: 0;  
}

@media (min-width: 480px) {
  html.js .breadcrumb li {
    display: flex;
    max-width: 100%;
    visibility: visible;
    z-index: 0;
  }
}

/* Helpers */
 .invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
} 

/* JS BREAKPOINTS */
/* as described here: https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript */
body:before {
  content: "smartphone";
  display: none;
}

@media (min-width: 480px) {
  body:before {
    content: "smartphone_wide";
  }
}

              
            
!

JS

              
                var collapseList = function () {

  var breadcrumbList = $('#breadcrumbList');
  var breadcrumbListElement = $('#breadcrumbList li');
  var button = '<button aria-expanded="false" id="collapse" aria-controls="breadcrumbList" title="collapse navigation" type="button"><span class="invisible"></span>&hellip;</button>';
  var breadcrumbSize = breadcrumbListElement.length;

  // breakpoint smartphone (0 - 480px, see css)
  if (breakpoint.value === 'smartphone') {
    
    // only collapse breadcrumb, when it contains more than 4 items
    if (!$('#collapse').length > 0 && breadcrumbSize > 4) {

      // put collapse button close to homepage link
      $('#home').append(button);

      var collapse = $('#collapse');

      // get hidden list elements
      var hiddenElements = $(breadcrumbListElement).filter(function() {
        return $(this).css('visibility') == 'hidden';
      });

      // helper function to determine object size
      Object.size = function(obj) {
        var size = 0, key;
        for (key in obj) {
          if (obj.hasOwnProperty(key)) size++;
        }
        return size;
      };

      var size = Object.size(hiddenElements);

      // set help text for buttons title attribute and hidden text
      var helpText = 'Show ' + size + ' more navigation levels';
      $(collapse).attr('title', helpText);
      $(collapse).find('.invisible').append(helpText);

      // collapse other elements (css) by setting class on list and remove collapse button
      $(collapse).click(function(){
        $(breadcrumbList).addClass('js-expanded');
        $(collapse).remove();
      });
    }
  }
  // breakpoint smartphone_wide (480px +, see css)
  if (breakpoint.value === 'smartphone_wide') {
    $('#collapse').remove();
    $(breadcrumbList).removeClass('js-expanded');
  }
}

/* JS BREAKPOINTS */
/* as described here: https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript */
var breakpoint = {};
breakpoint.refreshValue = function() {
  this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/\"/g, '');
};
$(window).resize(function() {
  breakpoint.refreshValue();
  collapseList();
}).resize();

$(document).ready(function(){
  breakpoint.refreshValue();
});
              
            
!
999px

Console