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

              
                    <div class="wrapper">  
      <ul class="list">
        <li class="items"><img src="http://kenichiro.mixh.jp/study/assets/img/roundbox_01.jpg" alt=""></li>
        <li class="items"><img src="http://kenichiro.mixh.jp/study/assets/img/roundbox_02.jpg" alt=""></li>
        <li class="items"><img src="http://kenichiro.mixh.jp/study/assets/img/roundbox_03.jpg" alt=""></li>
        <li class="items"><img src="http://kenichiro.mixh.jp/study/assets/img/roundbox_04.jpg" alt=""></li>
        <li class="items"><img src="http://kenichiro.mixh.jp/study/assets/img/roundbox_05.jpg" alt=""></li>
      </ul>

    </div>
              
            
!

CSS

              
                ul.list {
  display: flex; // 1.リストアイテムを横並びにする
  // width: 88%; //3.今回は不採用
  // margin: 0 auto; //3.今回は不採用
  margin: 0 6%; //3.リスト自体の左右に余白を作る
  flex-wrap: wrap; //4.横並びになったリストアイテムを折り返す
}
li.items {
  margin-left: 7px; //5.画像と画像の間に余白を設定する
  &:first-child {
    margin-left: 0;
  }
  width: calc((100% - 28px) / 5); // 6.画像と画像間の余白を1列に収める
}
img {
  width: 100%; // 2.画像が要素内で100%のサイズで表示される様にする
}

////////////共通設定////////////
ul {
  background: #B3CFDA;
  margin: 0;
  padding: 0;
}
li {
  background: #F6BFC7;
  margin-bottom: 10px;
}
.wrapper {
  width: 600px;
  margin: 0 auto;
  margin-top: 30px;
  padding-top: 10px;
  background: #C1E7B8;
  text-align: center;
}
li {
  list-style: none;
}
img {
  //画像の下に出来る隙間を消すための設定
  vertical-align: bottom;
}

              
            
!

JS

              
                
              
            
!
999px

Console