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 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

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

              
                <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">
  <!--==============スライダープラグイン「Modaal」のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/Modaal/0.4.4/css/modaal.min.css">
</head>

<body>

  <div class="wrapper">
    <h1>Gallery</h1>
    <p>画像拡大に使用したライブラリ:<a href="http://humaan.com/modaal/" target="_blank">http://humaan.com/modaal/</a></p>
    <ul class="gallery">
      <li><a href="#gallery-1" class="gallery-list"><img src="https://assets.codepen.io/6329135/img_01.jpg" alt=""></a></li>
      <li><a href="#gallery-2" class="gallery-list"><img src="https://assets.codepen.io/6329135/img_05.jpg" alt=""></a></li>
      <li><a href="#gallery-3" class="gallery-list"><img src="https://assets.codepen.io/6329135/09.jpg" alt=""></a></li>
    </ul>

    <section id="gallery-1" class="hide-area">
      <p><img src="https://assets.codepen.io/6329135/img_01.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/img_02.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/img_03.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/img_04.jpg" alt=""><span class="caption">画像の説明</span></p>
    </section>

    <section id="gallery-2" class="hide-area">
      <p><img src="https://assets.codepen.io/6329135/img_05.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/img_06.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/07.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/08.jpg" alt=""><span class="caption">画像の説明</span></p>
    </section>

    <section id="gallery-3" class="hide-area">
      <p><img src="https://assets.codepen.io/6329135/09.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/10.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/11.jpg" alt=""><span class="caption">画像の説明</span></p>
      <p><img src="https://assets.codepen.io/6329135/12.jpg" alt=""><span class="caption">画像の説明</span></p>
    </section>
    <!--/wrapper-->
  </div>
  <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Modaal/0.4.4/js/modaal.min.js"></script>
</body>
              
            
!

CSS

              
                @charset "utf-8";

/*===モーダル表示のためのcss */

.hide-area {
  /*モーダル表示をする場所をあらかじめ隠す*/
  display: none;
}

.modaal-fullscreen .modaal-content-container {
  /*full画面の色設定*/
  background: #333;
  color: #fff;
  text-align: center;
}

.modaal-fullscreen .modaal-close {
  /*ボタンの色、位置*/
  background: none;
  right: 20px;
}

/*クローズボタンの×の色変更*/
.modaal-close:focus:after,
.modaal-close:focus:before,
.modaal-close:hover:after,
.modaal-close:hover:before {
  background: #666;
}

/*キャプション*/
.caption {
  display: block;
  padding: 10px 0;
}

/*=== サムネイル表示のためのcss */

.gallery {
  /*ベースになるギャラリーを横並びに*/
  display: flex;
  justify-content: space-between;
}

.gallery li {
  width: 33.333%;
  padding: 0 10px;
}

/*画像の横幅を100%にしてレスポンシブ化*/
img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom; /*画像の下にできる余白を削除*/
}

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

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

a {
  color: #333;
}

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

h1 {
  text-align: center;
  font-size: 6vw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 30px 0;
}

p {
  margin: 0 10px 10px 10px;
  word-wrap: break-word;
}

              
            
!

JS

              
                //画像をクリックしたら現れる画面の設定
$(".gallery-list").modaal({
  fullscreen: "true", //フルスクリーンモードにする
  before_open: function () {
    // モーダルが開く前に行う動作
    $("html").css("overflow-y", "hidden"); /*縦スクロールバーを出さない*/
  },
  after_close: function () {
    // モーダルが閉じた後に行う動作
    $("html").css("overflow-y", "scroll"); /*縦スクロールバーを出す*/
  }
});

              
            
!
999px

Console