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

              
                <div class="container">
  <h1>A Detailed Summary of Life</h1>
  <h4>Quotes from Monty Python's <i>The Meaning of Life</i></h4>
    <ul class="timeline">
      
        <li class="timeline">
          <div class="icon done"></div>
          <details class="panel">
            <summary>The Miracle of Birth</summary>
            <p><strong>Patient:</strong> Is it a boy or a girl?<br><br>
<strong>Obstetrician:</strong> Now, I think it's a little early to start imposing roles on it, don't you? Now, a word of advice. You may find that you suffer for some time a totally irrational feeling of depression. PND is what we doctors call it. So it's lots of happy pills for you, and you can find out all about the birth when you get home. It's available on Betamax, VHS, and Super 8.</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon done"></div>
          <details class="panel">
            <summary>Growth and Learning</summary>
            <p>And spotteth twice they the camels before the third hour. And so the Midianites went forth to Ram Gilead in Kadesh Bilgemath by Shor Ethra Regalion, to the house of Gash-Bil-Betheul-Bazda, he who brought the butter dish to Balshazar and the tent peg to the house of Rashomon, and there slew they the goats, yea, and placed they the bits in little pots. Here endeth the lesson.</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon working"></div>
          <details class="panel">
            <summary>Fighting Each Other</summary>
            <p>Here is better than home, eh, sir? I mean, at home if you kill someone they arrest you — here they'll give you a gun and show you what to do, sir. I mean, I killed fifteen of those buggers. Now, at home they'd hang me — here they'll give me a fucking medal, sir!</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon"></div>
          <details class="panel">
            <summary>Middle Age</summary>
            <p>It's real Hawaiian food served in an authentic medieval English dungeon atmosphere.</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon"></div>
          <details class="panel">
            <summary>Live Organ Transplants</summary>
            <p>Yeah, I know what it is, but...I'm using it!</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon"></div>
          <details class="panel">
            <summary>The Meaning of Life</summary>
            <p>That’s right, yeah. I’ve had a team working on this over the past few weeks, and what we’ve come up with can be reduced to two fundamental concepts. One, people are not wearing enough hats. Two, matter is energy. In the Universe there are many energy fields which we cannot normally perceive. Some energies have a spiritual source which act upon a person’s soul. However, this soul does not exist ab initio as orthodox Christianity teaches; it has to be brought into existence by a process of guided self-observation. However, this is rarely achieved owing to man’s unique ability to be distracted from spiritual matters by everyday trivia.</p>
          </details>
        </li>
      
        <li class="timeline">
          <div class="icon"></div>
          <details class="panel">
            <summary>Death</summary>
            <p>Well, you're dead now, so shut up.</p>
          </details>
        </li>
      
    </ul>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Raleway:400,600');

$wht    : #fff;
$blk    : #000;
$green  : #23b5af;
$yellow : #eeba4c;
$border : lighten($blk,85);
$bg     : darken($wht,2);

body{
  font-family: 'Raleway', sans-serif;
  background:$bg;
}

h1{
  text-align: center;
  padding:30px 0 0 0;
}

h4{
  font-size:1.2em;
  text-align: center;
  padding:0 0 30px 0;
}

.timeline {
  list-style: none;
  padding: 20px 0 20px;
  position: relative;
  
  &:before {
    top: 0;
    bottom: 0;
    position: absolute;
    content: "";
    width: 3px;
    background-color: $border;
    margin-left: -1.5px;
    left: 20px;
    
    @media (min-width: 576px) {
      left: 50%;
    }
  }
  
  > li {
    margin-bottom: 20px;
    position: relative;
    padding-left:55px;
    
    &:after, &:after {
      content: "";
      display: table;
      clear: both;
    }
    
    .panel {
      width: 100%;
      float: left;
      border-radius: 3px;
      overflow:hidden;
      position: relative;
      background:$wht;
      box-shadow: 1px 2px 80px 0 rgba($blk, 0.1);
      
      summary{
        display:block;
        user-select: none;
        outline:none;
        padding:20px;
        margin-bottom:0px;
        transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
        transition-property: margin, background;
        font-weight:600;
        
        &::-webkit-details-marker { display:none; }
        
        &:hover{
          background:rgba($blk, 0.1);
        }
      }
      
      p{
        padding:0 20px 10px;
      }
      
      &[open] summary{
        margin-bottom:20px;
        padding-bottom:20px;
        border-bottom:1px solid rgba($blk, 0.1);
      }
    }
    
    @media (min-width: 576px) {
      padding-left:0px;
      
      .panel {
        width: 50%;
      }
      
      &:not(:nth-child(even)) {
        padding-right: 90px;
      }

      &:nth-child(even) {
        padding-left: 90px;
        > :nth-child(even) {
          float: right;
        }
      }
    }
  
    > {
      .icon {
        color: $border;
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 2.5em;
        text-align: center;
        position: absolute;
        left: 20px;
        margin-left: -25px;
        background-color: $bg;
        z-index: 999;
        border-radius: 50%;
        font-family: Font Awesome\ 5 Free;
        &:before{content: "\f192";}
        
        @media (min-width: 576px) {
          left: 50%;
        }
        
        &.done {
          color: $green;
          &:before{content: "\f058";}
        }
        
        &.working {
          color: $yellow;
          &:before{content: "\f017";}
        }
        
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console