Pen Settings



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


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.


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.


  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="">
  <link rel="stylesheet" type="text/css" href="">


  <div class="wrapper">
    <h1>Slide show</h1>
    <ul class="slider">
      <li class="slider-item"><img src="" /></li>
      <!-- 横幅を広げると「object-position: 50% 30%」で中央やや上の画像を表示 -->
      <li class="slider-item"><img src="" style="object-position: 50% 30%" /></li>
      <li class="slider-item"><img src="" /></li>

background: url("xxx");が動かない
      <li class="slider-item slider-item01"></li>
      <li class="slider-item slider-item02"></li>
      <li class="slider-item slider-item03"></li>


  <div class="container">
    <p>使用したライブラリ:<a href="" target="_blank"></a></p>

  <script src="" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src=""></script>


                @charset "utf-8";

.slider {
  position: relative;
  z-index: 1;
  height: 100vh; /*スライダー全体の縦幅を画面の高さいっぱい(100vh)にする*/

/* 背景画像設定 */
/*  なぜか背景が表示されない
.slider-item01 {
  background: url("");

.slider-item02 {
  background: url("");

.slider-item03 {
  background: url("");

.slider-item img {
  width: 100%; /*各スライダー全体の横幅を画面の高さいっぱい(100%)にする*/
  height: 100vh; /*各スライダー全体の縦幅を画面の高さいっぱい(100vh)にする*/
  background-repeat: no-repeat; /*背景画像をリピートしない*/
  background-position: center; /*背景画像の位置を中央に*/
  background-size: cover; /*背景画像が.slider-item全体を覆い表示*/
  object-fit: cover; /*画像の縦横比を保持したまま画像を中央表示*/


.slick-next {
  position: absolute; /*絶対配置にする*/
  z-index: 3;
  top: 42%;
  cursor: pointer; /*マウスカーソルを指マークに*/
  outline: none; /*クリックをしたら出てくる枠線を消す*/
  border-top: 2px solid #ccc; /*矢印の色*/
  border-right: 2px solid #ccc; /*矢印の色*/
  height: 25px;
  width: 25px;

.slick-prev {
  left: 2.5%;
  transform: rotate(-135deg);

.slick-next {
  right: 2.5%;
  transform: rotate(45deg);


.slick-dots {
  position: relative;
  z-index: 3;
  text-align: center;
  margin: -50px 0 0 0;

.slick-dots li {
  display: inline-block;
  margin: 0 5px;

.slick-dots button {
  color: transparent;
  outline: none;
  width: 8px; /*ドットボタンのサイズ*/
  height: 8px; /*ドットボタンのサイズ*/
  display: block;
  border-radius: 50%;
  background: #ccc; /*ドットボタンの色*/

.slick-dots .slick-active button {
  background: #333; /*ドットボタンの現在地表示の色*/

/*========= レイアウトのためのCSS ===============*/
ul {
  margin: 0;
  padding: 0;
  list-style: none;

a {
  color: #fff;

a:active {
  text-decoration: none;

h1 {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 6vw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;

.wrapper {
  position: relative;

.container {
  background: #555;

.container p {
  padding: 300px 0;
  text-align: center;
  color: #fff;



  autoplay: true, //自動的に動き出すか。初期値はfalse。
  autoplaySpeed: 3000, //次のスライドに切り替わる待ち時間
  speed: 1000, //スライドの動きのスピード。初期値は300。
  infinite: true, //スライドをループさせるかどうか。初期値はtrue。
  slidesToShow: 1, //スライドを画面に3枚見せる
  slidesToScroll: 1, //1回のスクロールで3枚の写真を移動して見せる
  arrows: true, //左右の矢印あり
  prevArrow: '<div class="slick-prev"></div>', //矢印部分PreviewのHTMLを変更
  nextArrow: '<div class="slick-next"></div>', //矢印部分NextのHTMLを変更
  dots: true, //下部ドットナビゲーションの表示
  pauseOnFocus: false, //フォーカスで一時停止を無効
  pauseOnHover: false, //マウスホバーで一時停止を無効
  pauseOnDotsHover: false //ドットナビゲーションをマウスホバーで一時停止を無効

$(".slider").on("touchmove", function (event, slick, currentSlide, nextSlide) {