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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<div class="content">
    <ul class="timeline">
        <li>
            <p>Timeline record</p>
            <span>May 2011</span>
        </li>
        <li>
            <p>Some short record in gray box</p>
            <span>June 2012</span>
        </li>
        <li>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
                dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
                ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
                fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
                deserunt mollit anim id est laborum.
            </p>
            <span>July 2013</span>
        </li>
        <li>
            <p>The long expected record. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
                incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.
            </p>
            <span>August 2014</span>
        </li>
        <li>
            <p>Finally! Last record in timeline </p>
            <span>October 2015</span>
        </li>
    </ul>

</div>
</body>
</html>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-family: sans-serif;
}

.content {
  width: 980px;
  margin: 80px auto;
}

ul.timeline {
  margin: 0;
  padding: 0;
  list-style-type: none;
  border-right: 6px solid #74c53a;
  width: 50%;

  li {
    margin: 40px 0;
    display: block;
    position: relative;

    span {
      position: absolute;
      top: calc(~'50% - 10px');
      font-weight: bold;
    }

    p {
      -moz-border-radius: 5px;
      -webkit-border-radius: 5px;
      border-radius: 5px;
      margin: 1em 28px;
      padding: 3em;
      text-align: center;
      line-height: 2.1;
    }

    .timelinePoint() {
      content: "";
      background: #74c53a;
      width: 10px;
      height: 10px;
      border: 3px solid #fff;
      position: absolute;
      -moz-border-radius: 50px;
      -webkit-border-radius: 50px;
      border-radius: 50 spx;
    }

    &:nth-child(odd) {

      p {
        color: #fff;
        background: #d74327;

        &:after {
          width: 12px;
          content: '';
          position: absolute;
          display: block;
          border-width: 22px 0 22px 16px;
          border-style: solid;
          border-color: transparent #d74327
        ;
          right: 0;
          top: 50%;
          top: calc(~'50% - 22px');
        }
      }

      span {
        left: 100%;
        margin-left: 20px;
        white-space: nowrap;
        color: #d74327;
      }

      &:after {
        .timelinePoint();
        float: left;
        top: 50%;
        top: calc(~'50% - 8px');
        right: -11px;
        background-color: #d74327;

      }
    }

    &:nth-child(even) {
      left: 100%;
      margin-left: 6px;

      p {
        border: 1px solid #ddd;

        &:after {
          width: 0;
          content: '';
          position: absolute;
          display: block;
          border-width: 22px 16px 22px 0;
          border-style: solid;
          border-color: transparent #fff
        ;
          left: 13px;
          top: 50%;
          top: calc(~'50% - 22px');
        }

        &:before {
          width: 0;
          content: '';
          position: absolute;
          display: block;
          border-width: 22px 16px 22px 0;
          border-style: solid;
          border-color: transparent #ddd
        ;
          left: 12px;
          top: 50%;
          top: calc(~'50% - 22px');
        }

      }

      span {
        right: 100%;
        margin-right: 20px;
        white-space: nowrap;
        color: #74c53a;
      }

      &:before {
        .timelinePoint();
        float: right;
        top: calc(~'50% - 8px');
        left: -11px;
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console