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


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.


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.


                <section class="carrousel">

  <div class="slide active" style="background-image: url('')">
    <div class="textbox">
      <h1>St. Maarten</h1>
      <p>Bacon ipsum dolor amet t-bone venison filet mignon pork chop shoulder turducken bresaola brisket tongue landjaeger leberkas corned beef.</p>

  <div class="slide" style="background-image: url('')">
    <div class="textbox">
      <p>Beef tongue landjaeger venison ham hock jerky bacon porchetta short ribs picanha ribeye pork chop t-bone kielbasa.</p>

  <div class="slide" style="background-image: url('')">
    <div class="textbox">
      <p>Corned beef beef ribs porchetta, pork loin andouille venison bresaola filet mignon brisket pig. Pork turkey beef picanha. Strip steak shoulder sausage doner short ribs drumstick pork belly pork chop.</p>




                .carrousel {
  position: relative;
  max-width: 500px;
  height: 300px;
  @media screen and (max-width: 529px) {
    margin: 30px;
  @media screen and (min-width: 530px) {
    margin: 30px auto;

  .slide {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0 15px;
    border-radius: 6px;
    background-size: cover;

    &.active {
      display: block;

    .textbox {
      position: absolute;
      top: 20px;
      left: 20px;
      width: 200px;
      padding: 7px 10px 0;
      border-radius: 4px;
      background: rgba(255, 255, 255, .75);
    h1, h2 {
      font-size: 22px;
      margin: 0;
    p {
      font-size: 15px;
      margin-top: 5px;



                var intervalSpeed = 3000;
var animationSpeed = 500;
var $carrousel = $('.carrousel');
// Run animation forever
setInterval(nextSlide, intervalSpeed);

function nextSlide() {

  // Find the currently active slide
  var $activeSlide = $('.active', $carrousel);

  // Find the next slide (or the first)
  var $nextSlide = $;
  if ($':last-child')) {
    $nextSlide = $('.slide', $carrousel).first();

  // Animate active slide to hidden

  // Animate next slide to shown