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

              
                <p class="explanation"> So this says 'Slider' but the testimonials fade-in and out... to change that, simply edit the css inside the keyframe animations (transform-translate, using absolute positioning 'left', etc.)</p>
<div class="testimonial-slider">
  <ul class="slider">
    <li>
      <div class="testimonial-slider-content">
        <q>This is the first quote in your slider!</q>
        <p class="source">- Paul C, TX</p>
      </div>
    </li>
    <li>
      <div class="testimonial-slider-content">
        <q>Here is the second one, this is awesome!</q>
        <p class="source">- Ella M, TX</p>
      </div>
    </li>
    <li>
      <div class="testimonial-slider-content">
        <q>Next, the third quote - AMAZING!</q>
        <p class="source">- Blaine B, TX</p>
      </div>
    </li>
    <li>
      <div class="testimonial-slider-content">
        <q>This is the last quote, I can't believe how well this worked!</q>
        <p class="source">- Guillermo O, TX</p>
      </div>
    </li>
  </ul>
</div>
              
            
!

CSS

              
                body {
  background-color: #536bc1;
  padding: 50px 30px;
  text-align: center;
  color: #fff;
  font: normal normal 24px / 1.25 "Raleway", Helvetica, Arial, Verdana, sans-serif;
}

body p {
  max-width: 60ch;
  margin: 0 auto 2em;
}

.testimonial-slider {
   display: block;
   width: 100%;
   height: auto;
   margin-top: 100px;
}

.testimonial-slider ul.slider {
   display: block;
   list-style: none;
   padding: 0;
   position: relative;
   display: inline-block;
   width: 100%;
   height: 350px;
   overflow: hidden;
   margin: 0 auto;
}

.testimonial-slider ul.slider li {
    position: absolute;
    display: block;
    width: 100%;
    opacity: 0;
    margin: 0 auto;
}
.testimonial-slider ul.slider li:nth-child(1) {
    opacity: 1;

    -webkit-animation: fade-animation-1 25s infinite;
            animation: fade-animation-1 25s infinite;
}
.testimonial-slider ul.slider li:nth-child(2) {
    -webkit-animation: fade-animation-2 25s infinite;
            animation: fade-animation-2 25s infinite;
}
.testimonial-slider ul.slider li:nth-child(3) {
    -webkit-animation: fade-animation-3 25s infinite;
            animation: fade-animation-3 25s infinite;
}
.testimonial-slider ul.slider li:nth-child(4) {
    -webkit-animation: fade-animation-4 25s infinite;
            animation: fade-animation-4 25s infinite;
}

.testimonial-slider q {
   display: inline-block;
   font: normal 700 50px / 1.25 "Raleway", Helvetica, Arial, Verdana, sans-serif;
   letter-spacing: .5pt;
   text-shadow: 0 5px 10px rgba(0,0,0,.1);
   max-width: 35ch;
}

.testimonial-slider .source {
    margin-top: 25px;
    color: #d9e0f9;
    font: italic 400 30px / 1.35 "Raleway", Helvetica, Arial, Verdana, sans-serif;
}

/* KEYFRAME DECLARATIONS */
@keyframes fade-animation-1 {
    0%, 25%, 100% {
        opacity:0
    }
    3%, 22% {
        opacity: 1;
    }
}
@keyframes fade-animation-2 {
    0%, 25%, 50%, 100% {
        opacity:0
    }
    28%, 47% {
        opacity: 1;
    }
}
@keyframes fade-animation-3 {
    0%, 50%, 75%, 100% {
        opacity:0
    }
    53%, 72% {
        opacity: 1;
    }
}
@keyframes fade-animation-4 {
    0%, 75%, 100% {
        opacity:0
    }
    78%, 97% {
        opacity: 1;
    }
}

@-webkit-keyframes fade-animation-1 {
    0%, 25%, 100% {
        opacity:0
    }
    3%, 22% {
        opacity: 1;
    }
}
@-webkit-keyframes fade-animation-2 {
    0%, 25%, 50%, 100% {
        opacity:0
    }
    28%, 47% {
        opacity: 1;
    }
}
@-webkit-keyframes fade-animation-3 {
    0%, 50%, 75%, 100% {
        opacity:0
    }
    53%, 72% {
        opacity: 1;
    }
}
@-webkit-keyframes fade-animation-4 {
    0%, 75%, 100% {
        opacity:0
    }
    78%, 97% {
        opacity: 1;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console