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

              
                <div class="component" id="demo">
  <div class="carousel slide carousel-fade" data-ride="carousel">
    <div class="carousel-inner">
      <div class="carousel-item active">
        <img src="https://www.102like.com/manage/0/product/30802/1516761523_922.jpg" alt="" class="d-block w-100">
      </div>
      <div class="carousel-item">
        <img src="https://img1.how01.com/imgs/bb/8c/4/1b7f0006b47ee1eec676.jpg" alt="" class="d-block w-100">
      </div>
      <div class="carousel-item">
        <img src="https://img.ruten.com.tw/s2/d/27/36/21813814532918_258.jpg" alt="" class="d-block w-100">
      </div>
    </div>
  </div>
</div>

<!-- 結構為.carousel .carousel-inner .carousel-item
.carousel-item 子元素為img
img的屬性有.d-block與.w-100佔據一整行以及寬度100% -->
<!-- 記住要在第一個.carousel-item加入.active,否則圖片不會出現 -->
<!-- 目前沒有幻燈片效果,如要幻燈片效果在.carousel這一層添加data-ride="carousel" -->
<!-- 滑動效果的話,需要在.carousel添加.slider -->
              
            
!

CSS

              
                #demo.component{
  padding: 50px;
}
              
            
!

JS

              
                
              
            
!
999px

Console