cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <h2>css3 vertical timeline</h2>

<ul id='timeline'>
  <li class='work'>
    <input class='radio' id='work5' name='works' type='radio' checked>
    <div class="relative">
      <label for='work5'>Lorem ipsum dolor sit amet</label>
      <span class='date'>12 May 2013</span>
      <span class='circle'></span>
    </div>
    <div class='content'>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ea necessitatibus quo velit natus cupiditate qui alias possimus ab praesentium nostrum quidem obcaecati nesciunt! Molestiae officiis voluptate excepturi rem veritatis eum aliquam qui laborum non ipsam ullam tempore reprehenderit illum eligendi cumque mollitia temporibus! Natus dicta qui est optio rerum.
      </p>
    </div>
  </li>
  <li class='work'>
    <input class='radio' id='work3' name='works' type='radio'>
    <div class="relative">
      <label for='work3'>Lorem ipsum dolor sit amet</label>
      <span class='date'>10 May 2013</span>
      <span class='circle'></span>
    </div>
    <div class='content'>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ea necessitatibus quo velit natus cupiditate qui alias possimus ab praesentium nostrum quidem obcaecati nesciunt! Molestiae officiis voluptate excepturi rem veritatis eum aliquam qui laborum non ipsam ullam tempore reprehenderit illum eligendi cumque mollitia temporibus! Natus dicta qui est optio rerum.
      </p>
    </div>
  </li>
</ul>
            
          
!
            
              /* 
 * ie7.js makes selectors work on IE
 * https://code.google.com/p/ie7-js/
 */

$bg: #48b379;
$white: #eee9dc;
$red: #f98262;

@import url(https://fonts.googleapis.com/css?family=Noto+Sans);

body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
  font-size: 100%;
  font-family: 'Noto Sans', sans-serif;
  color: $white;
  background: $bg;
}
h2 {
  margin: 3em 0 0 0;
  font-size: 1.5em;
  letter-spacing: 2px;
  text-transform: uppercase;
}
#timeline {
  list-style: none;
  margin: 50px 0 30px 120px;
  padding-left: 30px;
  border-left: 8px solid $white;
  li {
    margin: 40px 0;
    position: relative;
  }
  p {
    margin: 0 0 15px;
  }
}
.date {
  margin-top: -10px;
  top: 50%;
  left: -158px;
  font-size: 0.95em;
  line-height: 20px;
  position: absolute;
}
.circle {
  margin-top: -10px;
  top: 50%;
  left: -44px;
  width: 10px ;  
  height: 10px;
  background: $bg;
  border: 5px solid $white;
  border-radius: 50%;
  display: block;
  position: absolute;
}
.content {
  max-height: 20px;
  padding: 50px 20px 0;
  border-color: transparent;
  border-width: 2px;
  border-style: solid;
  border-radius: 0.5em;
  position: relative;
  &:before, &:after {
    content: "";
    width: 0;
    height: 0;
    border: solid transparent;
    position: absolute;
    pointer-events: none;
    right: 100%;
  }
  &:before {
    border-right-color: inherit;
    border-width: 20px;
    top: 50%;
    margin-top: -20px;
  }
  &:after {
    border-right-color: $bg;
    border-width: 17px;
    top: 50%;
    margin-top: -17px;
  }
  p {
    max-height: 0;
    color: transparent;
    text-align: justify;
    word-break: break-word;
    hyphens: auto;
    overflow: hidden;
  }
}
label{
  font-size: 1.3em;
  position: absolute;
  z-index: 100;
  top: 20px;
  -webkit-transition: -webkit-transform 0.2s linear;
}
.radio {
  display: none;
}
.radio:checked {
  & + .relative {
    label {
      cursor: auto;
      -webkit-transform: translateX(42px);
    }
    .circle {
       background: $red; 
    }
  }
  & ~ .content {
    max-height: 180px;
    border-color: $white;
    margin-right: 20px;
    -webkit-transform: translateX(20px);
    -webkit-transition: max-height 0.4s linear, border-color 0.5s linear, -webkit-transform 0.2s linear;
    p {
      max-height: 200px;
      color: $white;
      -webkit-transition: color 0.3s linear 0.3s;
    }
  }
}
            
          
!
999px
Loading ..................

Console