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

              
                
<h1 class="section-title">The story of a wonderful kid</h1>

<section class="timeline">

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year">1989</h3>
            <p class="timeline__text--left">
                The birth of a wonderful,  fabulous, adorable and lovable baby.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--right">
            <h3 class="timeline__year">1991</h3>
            <p class="timeline__text--right">
                Earliest memory of running to the door to welcome Daddy home.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year">1993</h3>
            <p class="timeline__text--left">
                Celebrated my birthday with my playmates in school. What a wonderful surprise to have the same birthday as my teacher!
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint timeline__midpoint--highlight no-top-margin">
            <h3 class="timeline__year">1999</h3>
        </div>
        <div class="timeline__content timeline__content--right">
            <h3 class="timeline__year timeline__year--mobile">1999</h3>
            <p class="timeline__text--right">
                Naughty kid get to school early in order to play catching around school compound.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year">2003</h3>
            <p class="timeline__text--left">
               Our cross country team won the fifth place - just one point away from the fourth and getting that tiny momento trophy and life-long glory. &#9785;
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--right">
            <h3 class="timeline__year">2008</h3>
            <p class="timeline__text--right">
                Bumpkin intern arrived in Disneyland.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint timeline__midpoint--highlight no-top-margin">
            <h3 class="timeline__year">2009</h3>
        </div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year timeline__year--mobile">2009</h3>
            <img class="timeline__img" src="" alt="">
            <p class="timeline__text--left">
                Thinking about the future.
            </p>
        </div>
    </div>

    

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year">2012</h3>
            <p class="timeline__text--left">
                Proudly present - the graduand.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint timeline__midpoint--highlight no-top-margin">
          <h3 class="timeline__year">2014</h3>
        </div>
        <div class="timeline__content timeline__content--right">
            <h3 class="timeline__year timeline__year--mobile">2014</h3>
            <p class="timeline__text--right">
                New direction.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--left">
            <h3 class="timeline__year">2015</h3>
            <img class="timeline__img" src="" alt="">
            <p class="timeline__text--left">
                Grateful to the everyone and the universe.
            </p>
        </div>
    </div>

    <div class="timeline__block">
        <div class="timeline__midpoint"></div>
        <div class="timeline__content timeline__content--right">
            <h3 class="timeline__year">Going forward</h3>
            <p class="timeline__text--right">
                Creating...
            </p>
        </div>
    </div>

</section>  

              
            
!

CSS

              
                /* typography */


/* get your beautiful color names from: http://www.colors.commutercreative.com/grid/ */
$headline: dimgrey;
$primary-color: cadetblue;
// $secondary-color: bisque;
// $tertiary-color: burlywood;
// $background-color: oldlace;
$matching-palette: honeydew;

/* media queries */

$tablet-width: 768px;
$desktop-width: 1024px;
@mixin tablet {
  @media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) {
    @content;
  }
}

@mixin desktop {
  @media (min-width: #{$desktop-width}) {
    @content;
  }
}

/* timeline layout */
html {
  background-color: $matching-palette;
  font-family: Arial, san-serif;
}

h1 {
  text-align: center;
  color: $headline;
  
}

.timeline {
  position: relative;
  margin-top: 55px;
  margin-left: 15px;
  &:before {
    /* vertical line*/
    content: '';
    position: absolute;
    top: 10px;
    /* to align with midline*/
    left: 7px;
    width: 2px;
    height: 97%;
    background-color: #cad2d6;
  }
}

.timeline__block {
  position: relative;
  margin-top: 42px;
  margin-bottom: 42px;
  padding-left: 15px;
  &:last-child {
    margin-bottom: 3em;
  }
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

.timeline__midpoint {
  position: absolute;
  top: 6px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: $primary-color;
  &:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    width: 15px;
    border-top: 1px solid #c5e1ec;
  }
}

.timeline__content {
  position: relative;
  margin-left: 20px;
  p + p {
    padding-top: 0;
  }
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

.timeline__midpoint--highlight > .timeline__year {
  display: none;
}


/* timeline typography */

.timeline__content .timeline__year {
  padding-top: 6px;
  color: $primary-color;
  text-align: left;
}

.timeline__midpoint--highlight .timeline__year {
  color: #fff;
  line-height: 4;
}

.timeline__year,
.timeline__midpoint--highlight + .timeline__content {
  font-weight: 600;
}

.timeline__content > p {
  font-size: 0.88em;
}


/* timeline layout for desktop */

@include desktop {
  section {
    padding: 0 250px;
  }
  .timeline {
    margin-left: 0;
    &:before {
      /* vertical line */
      left: 50%;
      margin-left: -1px;
    }
  }
  .timeline__midpoint {
    left: 50%;
    margin-left: -8px;
    &:before {
      width: 40px;
    }
    &:after {
      content: "";
      position: absolute;
      top: 50%;
      right: 16px;
      width: 40px;
      border-top: 1px solid #c5e1ec;
    }
  }
  .timeline__midpoint--highlight {
    top: 0;
    width: 76px;
    height: 76px;
    margin-left: -29px;
    margin-left: -38px;
    text-align: center;
    &.no-top-margin {
      margin-top: 0;
    }
    .timeline__year {
      display: block;
    }
  }
  .timeline__midpoint--highlight:before,
  .timeline__midpoint.timeline__midpoint--highlight:after {
    content: none;
  }
  .timeline__midpoint--highlight,
  .timeline__midpoint--highlight + .timeline__content {
    margin-top: 2em;
    margin-bottom: 2em;
  }
  .timeline__content {
    width: 50%;
    .timeline__year--mobile {
      display: none;
    }
  }
  .timeline__content--left {
    margin-left: -6%;
    .timeline__year {
      left: 128%;
    }
  }
  .timeline__year {
    position: absolute;
    width: 100%;
    margin-top: 0;
  }
  .timeline__text--left {
    padding-right: 25px;
    text-align: right;
  }
  .timeline__content--right {
    float: right;
    width: 53%;
    left: 11%;
    .timeline__year {
      right: 134%;
      text-align: right;
    }
    .timeline__text--right {
      margin-top: 0;
    }
  }
  .timeline__img {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }
  .timeline__content--left .timeline__img {
    left: 127%;
  }
  .timeline__content--right .timeline__img {
    right: 133.5%;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console