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

              
                <ul class="horizontal_scroll_list">
  <li>
      <img src="https://asbgm.com/img/1.jpg">
      <div class="scroll_list_title">タイトル</div>
      <div class="scroll_list_text">説明が入ります</div>
  </li>
  <li>
    <img src="https://asbgm.com/img/2.jpg">
    <div class="scroll_list_title">タイトル</div>
    <div class="scroll_list_text">説明が入ります</div>
  </li>
  <li>
    <img src="https://asbgm.com/img/3.jpg">
    <div class="scroll_list_title">タイトル</div>
    <div class="scroll_list_text">説明が入ります</div>
  </li>
  <li>
    <img src="https://asbgm.com/img/4.jpg">
    <div class="scroll_list_title">タイトル</div>
    <div class="scroll_list_text">説明が入ります</div>
  </li>
</ul>
              
            
!

CSS

              
                /* ====================================
  全体
==================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@700&display=swap');

body{
  font-family: 'Noto Sans JP', sans-serif;
  background: #111;
  padding: 0;
  margin: 0px auto;
  letter-spacing: 0.05em;
  width: 100%;
  max-width: 480px;
}

img {
	/* 画像保存禁止 */
	pointer-events: none;
}
/* ====================================
  //全体
==================================== */

/* ====================================
  横スクロールリスト
==================================== */
/* スクロールバーを非表示 */
::-webkit-scrollbar {
  display: none;
  -webkit-appearance: none;
}

/* リスト全体のスタイル */
.horizontal_scroll_list {
  display: flex;
  color: #333;
  max-width: 800px;
  min-width: 300px;
  overflow-x: auto;
  /* スクロール時に要素を左端に固定 */
  scroll-snap-type: x mandatory;
  scroll-padding: 0 0 0 10px;
}

/* 各リストのスタイル */
.horizontal_scroll_list li {
  width: 60%;
  padding: 0 0 10px 0;
  margin-right: 10px;
  flex-shrink: 0;
  list-style: none;
  background: #fff;
  border-radius: 10px;
  /* スクロール時に要素を左端に固定 */
  scroll-snap-align: start;
}

/* 最後の要素の右に余白 */
.horizontal_scroll_list li:last-of-type{
  margin-right: 10px;
}

.horizontal_scroll_list img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.scroll_list_title {
  padding: 5px 10px;
  font-size: 16px;
  font-weight: bold;
  text-align: left;
}

.scroll_list_text {
  padding: 0 10px;
  font-size: 12px;
  text-align: left;
}
/* ====================================
  //横スクロールリスト
==================================== */
              
            
!

JS

              
                
              
            
!
999px

Console