Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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 class="container-fluid">
  <div class="row flex-xl-nowrap">
    <div class="col-12">
      <div class="bd-example">
        <div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
          <ol class="carousel-indicators">
            <li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
            <li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
            <li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
            <li data-target="#carouselExampleCaptions" data-slide-to="3"></li>
          </ol>
          <div class="carousel-inner">
            <div class="carousel-item active">
              <div class="block4-wrap">
                <div class="block4"><img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=1" alt="First slide">
                  <div class="my-captions">
                    <h5>First slide label</h5>
                    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
                  </div>
                </div>
                <div class="block4"><img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=1" alt="First slide">
                  <div class="my-captions">
                    <h5>First slide label</h5>
                    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
                  </div>
                </div>
                <div class="block4"><img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=1" alt="First slide">
                  <div class="my-captions">
                    <h5>First slide label</h5>
                    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
                  </div>
                </div>
                <div class="block4"><img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=1" alt="First slide">
                  <div class="my-captions">
                    <h5>First slide label</h5>
                    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="carousel-item">
              <div class="block4-wrap">
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=2" alt="Second slide">
                  <div class="my-captions">
                    <h5>Second slide label</h5>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=2" alt="Second slide">
                  <div class="my-captions">
                    <h5>Second slide label</h5>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=2" alt="Second slide">
                  <div class="my-captions">
                    <h5>Second slide label</h5>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=2" alt="Second slide">
                  <div class="my-captions">
                    <h5>Second slide label</h5>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="carousel-item">
              <div class="block4-wrap">
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=3" alt="Third slide">
                  <div class="my-captions">
                    <h5>Third slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=3" alt="Third slide">
                  <div class="my-captions">
                    <h5>Third slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=3" alt="Third slide">
                  <div class="my-captions">
                    <h5>Third slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=3" alt="Third slide">
                  <div class="my-captions">
                    <h5>Third slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="carousel-item">
              <div class="block4-wrap">
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=4" alt="Fourth slide">
                  <div class="my-captions">
                    <h5>Fourth slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=4" alt="Fourth slide">
                  <div class="my-captions">
                    <h5>Fourth slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=4" alt="Fourth slide">
                  <div class="my-captions">
                    <h5>Fourth slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
                <div class="block4"> <img class="d-block w-100" src="http://placehold.it/500/bbb/fff&amp;text=4" alt="Fourth slide">
                  <div class="my-captions">
                    <h5>Fourth slide label</h5>
                    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <a class="carousel-control-prev" href="#carouselExampleCaptions" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleCaptions" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div>
      </div>
    </div>
  </div>
</div>

              
            
!

CSS

              
                .carousel-item img {
	margin:10px;
}
.block4-wrap {
	display:flex
}
.block4 {
	flex:1 0 25%;
	background:#000;
	color:#fff;
}
.my-captions{margin:10px;padding-bottom:3em}

/* fix width and make user scroll with mouse/touch to see the items */
@media screen and (max-width:768px){
	.block4{max-width:280px;flex:1 0 100%;overflow:hidden}	
	.carousel{overflow:hidden;}
	.carousel-inner{overflow-x:visible;}
}
@media screen and (max-width:480px){
	.block4{max-width:240px;}	
}


              
            
!

JS

              
                
              
            
!
999px

Console