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 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

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

              
                <!--hovering over the images will pause the slideshow -->

<section class="slideshow">
  <div class="slideshow-container slide">
    <img src="http://placeimg.com/625/225/any"/>
    <div class="text-container">
      <p> I work with text too! And I'm just testing length here and stuff it's cool you know because that's important to do I guess hey did I ever tell you about that time that I did that stuff with the thing</p>
    </div>
    <img src="http://placeimg.com/625/225/animals"/>
    <img src="http://placeimg.com/625/225/arch"/>
  </div>
</section>

<p class="p">Demo by Tim Evko. <a href="http://www.sitepoint.com/you-dont-need-javascript-for-that" target="_blank">See article</a>.</p>
              
            
!

CSS

              
                /*general styles*/

body{padding: 3em;background-color: #ccc;}
html {box-sizing: border-box;}
*, *:before, *:after {box-sizing: inherit;}


/*slideshow styles*/

.slideshow {
  width: 625px;
  margin: 0 auto;
  overflow: hidden;
  border: solid 1px white;
}

.slideshow-container {
  width: 2500px;
  font-size: 0;
  transition: 1s ease;
  height: 225px;
}

.slideshow-container:hover {
  animation-play-state: paused;
}

img, .text-container {
  width: 625px;
  height: auto;
  display: inline-block;
  font-size: 16px;
  text-align: center;
}

.text-container {
  height: 225px;
  position: relative;
}


p {
  position: relative;
  top: -45%;
  padding: 5px;
}

.slide {
  animation: slide 24s ease infinite;
}

@keyframes slide {
  0% {
    transform: translateX(0%);
  }
  
  12.5% {
    transform: translateX(0%);
  }
  
  25% {
    transform: translateX(-25%);
  }
  
  37.5% {
    transform: translateX(-25%);
  }
  
  50% {
    transform: translateX(-50%);
  }
  
  62.5% {
    transform: translateX(-50%);
  }
  
  75% {
    transform: translateX(-75%);
  }
  
  87.5% {
    transform: translateX(-75%);
  }
  
  99% {
    transform: translateX(-75%);
  }
  
  100% {
    transform: translateX(0);
  }
}

.p {
  margin-top: 140px;
  text-align: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console