Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


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.


<template id="article-item-template">
<li class="article-item">
  <time datetime=""></time>
  <a href=""></a>
    time {
      display: block;
    a {
      text-decoration: none;
<script id="jsonld" type="application/ld+json">
    "@context": "",
    "@type": "BlogPosting",
    "name": "シンタックスハイライトをgoogle code prettifyからhighlight.jsに変えた",
    "url": "",
    "datePublished": "2015-03-19T00:37:31+09:00"
    "@context": "",
    "@type": "BlogPosting",
    "name": "ABCテレビ キャストで「コーンポタージュのコーンを上手く食べる方法を流体解析してみた」が使用されました",
    "url": "",
    "datePublished": "2015-03-13T13:09:01+09:00"
    "@context": "",
    "@type": "BlogPosting",
    "name": "Mobile SafariのselectがイケてないのでほぼCSSで擬似select作ってみた",
    "url": "",
    "datePublished": "2015-03-02T22:41:27+09:00"
<ul class="article-list"></ul>
<p><time datetime="2015-03">2015年03年</time>の<a href="/2015/03/">記事一覧へ</a></p>




                // JSON-LDの中身を取得してオブジェクトに変換
var json = JSON.parse(document.getElementById('jsonld').textContent);

var t = document.getElementById('article-item-template');

var fragment = document.createDocumentFragment();

for ( var i = 0; i < json.length; i++ ) {
  var item = document.importNode(t.content, true);

  var a = item.querySelector('a');
  a.setAttribute('href', json[i].url);
  a.textContent = json[i].name;
  var time = item.querySelector('time');
  time.setAttribute('datetime', json[i].datePublished);
  time.textContent = json[i].datePublished;

var list = document.body.querySelector('.article-list');

list.appendChild(fragment); //クローン要素をlistに追加