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.

+ add another resource


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


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.


                <div class="gallery">
  <div class="thumb london" data-caption="Westminster Bridge at dusk, London"></div>
  <div class="thumb paris" data-caption="The Eiffel tower, Paris"></div>
  <div class="thumb sf" data-caption="Golden Gate bridge at sunset, San Francisco"></div>


                .gallery {
  position: relative;
.gallery:hover .thumb {
  opacity: .7;
.thumb {
  height: 100px;
  width: 12.5%;
  background: no-repeat center center;
  background-size: cover;
  transition: opacity 600ms;  
.gallery .thumb:hover {
  opacity: 1; /* overrides blur, so active img is not blurred */
.thumb:before, .thumb:after { 
  opacity: 0; 
  width: 45%;
.thumb:last-of-type:before, .thumb:last-of-type:after { opacity: 1; }
.thumb:hover:before, .thumb:hover:after { 
  z-index: 100; /* so this image stays on top */
  opacity: 1;
  transition: opacity 2000ms;
/* this is the full-size image  */
.thumb:before { 
  content: '';
  position: absolute;
  top: 0; left: 12.5%;
  height: 100%;
  padding-left: 20px; /* creates gap */
  background: inherit;
  background-position: 20px center; /* moves the image slightly right so there's a gap between thumbnails and full-size */
/* this is the caption */
.thumb:after {
  content: attr(data-caption);
  position: absolute;
  bottom: 0;
  left: 15%;
  height: 1em;
  padding-bottom: .5em;
  text-align: center;
  font-size: 1.4rem;
  font-style: italic;
  color: #fff;

* CSS below just sets src of each image
* could also be applied inline with HTML if needed to be dynamic
*/ {
  background-image: url(;
} {
  background-image: url(;
.thumb.sf {
  background-image: url(;