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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="church-container">
  <label for="vallbona">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/vallbona-de-les-monges_thumb.jpg" alt>
  </label>
  <input type="radio" id="vallbona" name="churchy">
  
  <label for="woodward">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/woodward-avenue-presbyterian_thumb.jpg">
  </label>
  <input type="radio" id="woodward" name="churchy" checked>
  
  <label for="woodward2">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/woodward-avenue-presbyterian2_thumb.jpg" alt></label>
  <input type="radio" id="woodward2" name="churchy">
  <div id="churches">
    <figure id="monges">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/vallbona-de-les-monges.jpg" alt="Photograph of a corridor in Vallbona de les monges Monastery, Catalonia, Spain by José Luis Mieza">
      <figcaption>Vallbona de les monges Monastery, Catalonia, Spain</figcaption>
    </figure>
    <figure id="presby">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/woodward-avenue-presbyterian.jpg" alt="Interior photograph of Woodward Avenue Presbyterian Church in Detroit Michigan by Rich Harris">
      <figcaption>Woodward Avenue Presbyterian Church, Detroit Michigan</figcaption>
    </figure>
    <figure id="presby2">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/woodward-avenue-presbyterian2.jpg" alt="Interior photograph of Woodward Avenue Presbyterian Church in Detroit Michigan by Rich Harris">
      <figcaption>Woodward Avenue Presbyterian Church, Detroit Michigan</figcaption>
    </figure>
  </div>
</div>
              
            
!

CSS

              
                body { 
  background: #111;
  font-family: Avenir, Arial, sans-serif; 
}
div#church-container {
  background: #111;
  overflow: hidden;
  position: relative;
  width: 80%;
  margin: 0 auto;
  max-width: 1000px;
}
div#church-container input[type="radio"] { display: none; }
div#church-container label img { 
 width: 20%;
 display: block;
 float: left;
 clear: left;
 border-right: 40px solid #111;
}
div#church-container label:hover { cursor: pointer; 
}
div#churches { 
 width: 90%;
 position: relative;
 margin-left: 22.5%;
}
div#churches figure { 
 margin: 0;
 position: absolute;
 height: 100%;
 opacity: 0;
 transform: scale(.8);
 transition: .5s all linear;
 width: 100%;
}
div#churches figure img { 
 width: 100%;
}
div#churches figure figcaption { 
 position: relative;
 background: rgba(0,0,0,.6);
 color: #fff;
 font-size: 1rem;
 padding: 1rem;
 transition: 1s 1s all linear;
 margin-top: 1.6rem;
 line-height: 1.4;
 text-align: left;
}
#vallbona:checked~#churches #monges,
#woodward:checked~#churches #presby,
#woodward2:checked~#churches #presby2 { 
 opacity: 1;
 transform: scale(1);
}
#vallbona:checked~#churches #monges figcaption, 
#woodward:checked~#churches #presby figcaption,
#woodward2:checked~#churches #presby2 figcaption { 
  top: -5rem; 
}


              
            
!

JS

              
                
              
            
!
999px

Console