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. 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.

+ 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

              
                <h1>Collection of ordererd Lists</h1>
<p>Some examples using the CSS attributes counter, counters, counter-reset and counter-increment.</p>
<h2>Simple</h2>
<div class="example">
  <ol class="foo reset">
    <li>A list item</li>
    <li>
      Another list item with a nested ordered list
      <ol>
        <li>Nested list item</li>
        <li>Another nested list item</li>
      </ol>
    </li>
    <li>And a last list item</li>			
  </ol>
</div>
<h2>Nested</h2>
<div class="example">
  <ol class="foo reset nested">
    <li>A list item</li>
    <li>
      Another list item with a nested ordered list
      <ol>
        <li>Nested list item</li>
        <li>Another nested list item</li>
      </ol>
    </li>
    <li>And a last list item</li>
    <li class="ie7cssTest">IE 7 css parser bug fixed? green: yes, red: no!</li>
  </ol>
</div>
<h2>Interrupted</h2>
<div class="example">
  <ol class="foo reset">
    <li>A list item</li>
    <li>Another list item</li>
  </ol>
  <p>Some other markup in between...</p>
  <ol  class="foo continued">
    <li>And continue with the list</li>
    <li>A last item</li>
  </ol>
</div>
<h2>Circled</h2>
<div class="example">
  <dl>
    <dt>I am the title!</dt>
    <dd>I am a description, Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.</dd>
    <dt>I am another title!</dt>
    <dd>I am another description: Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.</dd>
    <dt>I am another title!</dt>
    <dd>I am another description: Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.</dd>
  </dl>
</div>
<h2>Proceed</h2>
<div class="example">
  <ol class="proceed">
    <li class="done"><span>First this</span></li>
    <li class="done"><span>Then that</span></li>
    <li class="current"><span>Next here</span></li>
    <li class="to-come"><span>And done!</span></li>
  </ol>
</div>
              
            
!

CSS

              
                body {
  font-family: 'Source Sans Pro','Segoe UI','Roboto','Droid Sans','Helvetica Neue',Arial,sans-serif;
  background: #f2f2f2;
  padding: 1em 2em;
}

.example {
  border: 1px solid #ccc;
  margin-bottom: 2em;
  padding: .5em 1em;
  background: #fff;
}

.ie7cssTest {
  color: red;
}

.reset, .reset ol {
  counter-reset: item;  
}

.foo, .foo ol {
  list-style-type: none;
   
  li:before {
    content: counter(item) ". ";
    counter-increment: item;
  }
}
.nested ol {
  li:before {
    content: counters(item,".") " ";
  }
}

dl {
  counter-reset: item;  
  position: relative;
  
  &:before {
    height: 100%;
    width: 2px;
    content: '';
    position: absolute;
    background: #36bcab;
    left: .6em;
    z-idnex: 0;
  }
}

dt {
  margin: 0;
  padding: 0 0 0 2em;
  position: relative;
  font-weight: bold;
  
  
  &:before {
    border: 2px solid #36bcab;
    background: #fff;
    border-radius: 999px;
    width: 1.5em;
    height: 1.5em;
    line-height: 1.5em;
    text-align: center;
    color: #36bcab;
    display: block;
    content: counter(item);
    counter-increment: item;
    position: absolute;
    left: -.25em;
    top: 0;
    z-index: 2;
  }
}

dd {
  margin: 0 0 1em 0;
  padding: 0 0 0 2em;
  position: relative;
  z-index: 1;
  
}

dd:last-of-type {
   background: #fff;
}

.proceed {
  list-style-type: none;
  margin: 0;
  padding: 0 0 0 50px;
  counter-reset: item;  
  
  &:after {
    clear: both;
    content: '';
    visibility: hidden;
    display: block;
    
  }
  
  li {
    width: 25%;
    height: 50px;
    line-height: 50px;
    float: left;
    position: relative;
    padding-right: 50px;
    -moz-box-sizing: border-box; 
    -webkit-box-sizing: border-box; 
    box-sizing: border-box;
    font-size: 14px;
    
    span {
      display: block;
      background:#FF4CB3;
      white-space: nowrap;
      position: relative;
      color: #fff;
      padding-left: 20px;
      
      &:before {
        content: counter(item);
        counter-increment: item;
        position: absolute;
        font-size: 30px;
        line-height: 48px;
        color: #fff;
        left: -5px;
      }
    }
  
   
    &:after {
      content:'';
      border: solid transparent;
      display: block;
      width: 0px;
      height: 0px;
      margin-bottom: 20px;
      border-left-color: #FF4CB3;
      border-width: 25px;
      position: absolute;
      right: 0;
      top: 0;
    }
    
    &:before {
      content: "";
      position: absolute;
      left: -49px;
      height: 0;
      width: 0;
      border: solid 25px #FF4CB3;
      border-left-color: transparent;
    }
    
    &.done span:after {
      content: 'xx';
      display: block;
      position: absolute;
      width: 16px;
      height: 8px;
      margin-top: -10px;
      overflow: hidden;
      background: transparent;
      top: 50%;
      right: 5px;
      border: 3px solid rgba(255,255,255,0.5);
      border-top: none;
      border-right: none;
      z-index: 4;
      moz-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      -o-transform: rotate(-45deg);
      -webkit-transform: rotate(-45deg);
      transform: rotate(-45deg);
    }
  }
  
  .to-come {
      span {
        background: #CC0075;
      }
    
      &:before {
        border-color: #CC0075;
        border-left-color: transparent;
      }

      &:after {
        border-left-color: #CC0075;
      }
  }
  
  .current {
    height: 60px;
    line-height: 60px;
    z-index: 2;
    margin: -5px 0 0 -10px;
    
     span {
       background: #7F2659;
       
       &:before {
          line-height: 58px; 
       }
     }
    
    &:before {
      border-color: #7F2659;
      border-left-color: transparent;
      border-width: 30px;
    }
    
    &:after {
      border-left-color: #7F2659;
      border-width: 30px;
      right: -10px;
    }
  }
  
}


/* in some cases ie7 ignores all css rules after using counters attribute */
.ie7cssTest {
  color: green;
}


              
            
!

JS

              
                
              
            
!
999px

Console