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

              
                <head>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!--==============レイアウトを制御する独自のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/s/0z920nydj51coo7/reset3.css?dl=0">
  <!--==============スライダープラグイン「slick」のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css">
</head>

<body>
  <ul class="slider">
    <li><img src="https://assets.codepen.io/6329135/img_01.jpg" alt=""></li>
    <li><img src="https://assets.codepen.io/6329135/img_02.jpg" alt=""></li>
    <li><img src="https://assets.codepen.io/6329135/img_03.jpg" alt=""></li>
    <li><img src="https://assets.codepen.io/6329135/img_04.jpg" alt=""></li>
    <li><img src="https://assets.codepen.io/6329135/img_05.jpg" alt=""></li>
    <li><img src="https://assets.codepen.io/6329135/img_06.jpg" alt=""></li>
    <!--/slider-->
  </ul>
  <p>使用したライブラリ:<a href="https://kenwheeler.github.io/slick/" target="_blank">https://kenwheeler.github.io/slick/</a></p>

  <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
</body>
              
            
!

CSS

              
                @charset "utf-8";

/*==================================================
スライダーのためのcss
===================================*/
.slider img {
  width: 100%; /*スライダー内の画像を横幅100%に*/
  height: auto;
}

/*slickのJSで書かれるタグ内、スライド左右の余白調整*/

.slider .slick-slide {
  margin: 0 10px; /*スライド左右の余白調整*/
}

/*========= レイアウトのためのCSS ===============*/

body {
  background: #eee;
}

h2,
p {
  text-align: center;
  padding: 20px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: #333;
}

a:hover,
a:active {
  text-decoration: none;
}

              
            
!

JS

              
                $(".slider").slick({
  arrows: false, //左右の矢印はなし
  autoplay: true, //自動的に動き出すか。初期値はfalse。
  autoplaySpeed: 0, //自動的に動き出す待ち時間。初期値は3000ですが今回の見せ方では0
  speed: 6900, //スライドのスピード。初期値は300。
  infinite: true, //スライドをループさせるかどうか。初期値はtrue。
  pauseOnHover: false, //オンマウスでスライドを一時停止させるかどうか。初期値はtrue。
  pauseOnFocus: false, //フォーカスした際にスライドを一時停止させるかどうか。初期値はtrue。
  cssEase: "linear", //動き方。初期値はeaseですが、スムースな動きで見せたいのでlinear
  slidesToShow: 3, //スライドを画面に4枚見せる
  slidesToScroll: 1, //1回のスライドで動かす要素数
  responsive: [
    {
      breakpoint: 769, //モニターの横幅が769px以下の見せ方
      settings: {
        slidesToShow: 2 //スライドを画面に2枚見せる
      }
    },
    {
      breakpoint: 426, //モニターの横幅が426px以下の見せ方
      settings: {
        slidesToShow: 1.5 //スライドを画面に1.5枚見せる
      }
    }
  ]
});

              
            
!
999px

Console