css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!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>
            
          
!
            
              * {
  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;
      }
    }
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console