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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <h1 class="bandname">はっぴいえんど</h1>
<div class="spec">
  <section class="album">
    <h2 class="title"></h2>
    <p class="release"></p>
    <ol class="track"></ol>
  </section>
</div>
</section>

              
            
!

CSS

              
                
              
            
!

JS

              
                //アルバムデータ
var albums = [
{ //1枚目
  title: "はっぴいえんど",
  release: "1970/8/5",
  track: [
    "春よ来い",
    "かくれんぼ",
    "しんしんしん",
    "飛べない空",
    "敵タナトスを想起せよ!",
    "あやか市の動物園",
    "12月の雨の日",
    "いらいら",
    "朝",
    "はっぴいえんど",
    "続はっぴ-いいえ-んど"
  ]
},
{ //2枚目
  title: "風街ろまん",
  release: "1971/11/20",
  track: [
    "抱きしめたい",
    "空いろのくれよん",
    "風をあつめて",
    "暗闇坂むささび変化",
    "はいからはくち",
    "はいから・びゅーちふる",
    "夏なんです",
    "花いちもんめ",
    "あしたてんきになあれ",
    "颱風",
    "春らんまん",
    "愛餓を"
  ]
},
{ //3枚目
  title: "HAPPY END",
  release: "1973/2/25",
  track: [
    "風来坊",
    "氷雨月のスケッチ",
    "明日あたりはきっと春",
    "無風状態",
    "さよなら通り3番地",
    "相合傘",
    "田舎道",
    "外はいい天気",
    "さよならアメリカさよならニッポン"
  ]
}
]


//外枠アクセス
var spec = document.querySelector('.spec');

//テンプレ複製
//(アルバム枚数-1枚)
for (var i=1; i < albums.length; i++) {
  var clone = spec.firstElementChild.cloneNode(true);
  spec.appendChild(clone);
}


//タイトル、発売日、曲名アクセス
var specTitle = document.querySelectorAll('.title');
var specRelease = document.querySelectorAll('.release');
var specTrack = document.querySelectorAll('.track');


//アルバムデータ入力(アルバム枚数分)
for (var i=0; i < albums.length; i++) {  
  //タイトル入力
  specTitle[i].innerHTML = albums[i].title;
  //発売日入力
  specRelease[i].innerHTML = albums[i].release;
  //曲名入力(曲数分ループ)
  for(var t=0; t < albums[i].track.length; t++) {
    var list = document.createElement('li');
    list.innerHTML= albums[i].track[t];
   specTrack[i].appendChild(list);        
  }   
}
              
            
!
999px

Console