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

              
                <!-- slider全体を包む要素 -->
<div class="swiper">
<!-- 各スライド全体を包む要素 -->
<div class="swiper-wrapper">
<!-- 各スライドの要素 -->
<div class="swiper-slide slide1">slide1</div>
<div class="swiper-slide slide2">slide2</div>
<div class="swiper-slide slide3">slide3</div>
<div class="swiper-slide slide4">slide4</div>
<div class="swiper-slide slide5">slide5</div>
<div class="swiper-slide slide6">slide6</div>
<div class="swiper-slide slide7">slide7</div>
</div>
<!-- ナビゲーションボタン -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
              
            
!

CSS

              
                .swiper {
  width: 100%;
  height: 300px;
}

.swiper-slide {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}

.slide1 {
  background-color: #a3cce0;
}

.slide2 {
  background-color: #a4da1c;
}

.slide3 {
  background-color: #cb4651;
}

.slide4 {
  background-color: #DEC20B;
}

.slide5 {
  background-color: #8000ff;
}

.slide6 {
  background-color: #ca9797;
}

.slide7 {
  background-color: #f2c1d5;
}
              
            
!

JS

              
                const swiper = new Swiper(".swiper", {
  // 599px以下の場合
  slidesPerView: 1,
  spaceBetween: 10, 
  centeredSlides: true, 
  loop: true,
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev"
  },
  
  // ブレイクポイント
  breakpoints: {
      // 599px以上の場合
      599: {
        slidesPerView: 1.5,
      },
      // 980px以上の場合
      980: {
        slidesPerView: 3,
      },
   }
});
              
            
!
999px

Console