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

              
                <!-- Resize window to show how side by side they can overlap nicely, but not one on top of another :) -->

<div class="timeline-container">
  <ul class="timeline clearfix">

    <li class="timeline-column-left">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            First. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-right">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            Second, pushed down 80px by the height of the above list item. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-right">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            Third, also right but pushes down the 4th. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-left">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            4th respects the spacing of 2nd and 3rd, not just the 80px min-height but the full height of text content. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-left">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            This one is linked to the side. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-right timeline-column-right-join">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            You could use this to show related items. 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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-right">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            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.
          </div>
        </div>
      </div>
    </li>

    <li class="timeline-column-left">
      <div class="timeline-item">
        <div class="media-object">
          <div class="media-object-img"><img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm" alt=""></div>
          <div class="media-object-bd">
            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.
          </div>
        </div>
      </div>
    </li>

  </ul>
</div>
              
            
!

CSS

              
                /* Skip to line 29+ for timeline CSS */

/* ===== base ===== */
body {
  font: 14px/1.36 sans-serif;
}

/* ===== media object ===== */
.media-object { margin: 10px 0; } /* removed side margins as most use cases we have dont want this */
.media-object,
.media-object-bd { overflow: hidden; _overflow: visible; zoom: 1; min-width: 50%; }
.media-object-img { float:left; margin-right: 10px; margin-bottom: 10px; }
.media-object-img img { display:block;}
.media-object-imgExt { float:right; margin-left: 10px;}

/* ===== clearfix ===== */
.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}
.clearfix:after {
  clear: both;
}
.clearfix {
  *zoom: 1; /* For IE 6/7 (trigger hasLayout) */
}

/* ===== timeline ===== */
.timeline-container {
  position: relative;
}
/* create a line down the middle */
.timeline-container:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid #000;
}
.timeline {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

/* each item in the timeline */
.timeline li {
  /* overlapping between each timeline item at a max of 80px */
  min-height: 80px;
}
.timeline-item {
  position: relative;
  width: 50%;
}
/* classes to dictate if this item should show on the left or right in the list */
.timeline-column-left {
  clear: left;
}
.timeline-column-left .timeline-item {
  float: left;
}
.timeline-column-right {
  clear: right;
}
.timeline-column-right .timeline-item {
  float: right;
}
/* small lines contecting the item to the center line */
.timeline-item:before {
  content: "";
  position: absolute;
  top: 50px;
  border-top: 1px solid #000;
  width: 20px;
}
.timeline-column-left .timeline-item:before {
  right: 0;
}
.timeline-column-right .timeline-item:before {
  left: 0;
}
.timeline-column-left .media-object {
  margin-right: 30px;
}
.timeline-column-right .media-object {
  margin-left: 30px;
}
.timeline-column-left .media-object-img {
  float: right;
  margin-left: 10px;
  margin-right: 0;
}

/* timeline item bodys have a simple curved design next to the image */
.timeline-item .media-object-bd {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  padding: 1em;
}

/* offer way to join a right column next to a previous left, showing something specifcially related */
.timeline-column-right-join {
  margin-top: -80px; /* same as the <li>'s max height' */
}

              
            
!

JS

              
                
              
            
!
999px

Console