cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <table>
  <thead>
    <tr>
      <th rowspan="2">方法</th>
      <th rowspan="2">サンプル</th>
      <th colspan="3">Windows 7</th>
      <th colspan="3">OSX El Capitan</th>
    </tr>
    <tr>
      <th>Chrome 50</th>
      <th>Firefox 46</th>
      <th>IE 11</th>
      <th>Chrome 50</th>
      <th>Firefox 46</th>
      <th>Safari 9.1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>CSS で書いてみる</th>
      <td><textarea placeholder="CSS で" id="ph"></textarea></td>
      <td>× (※)</td><td>×</td><td>×</td>
      <td>× (※)</td><td>×</td><td>○</td>
    </tr>
    <tr>
      <th>実体参照 (HTML 10進数) で<br>CR LF (&amp;#13;&amp;#10;)</th>
      <td><textarea placeholder="感想を&#13;&#10;お書き&#13;&#10;ください"></textarea></td>
      <td>○</td><td>×</td><td>○</td>
      <td>○</td><td>×</td><td>×</td>
    </tr>
    <tr>
      <th>実体参照 (HTML 16進数) で<br>CR LF (&amp;#x000D;&amp;#x000A;)</th>
      <td><textarea placeholder="感想を&#x000D;&#x000A;お書き&#x000D;&#x000A;ください"></textarea></td>
      <td>○</td><td>×</td><td>○</td>
      <td>○</td><td>×</td><td>×</td>
    </tr>
    <tr>
      <th>属性値で改行</th>
      <td><textarea placeholder="感想を
お書き
ください"></textarea></td>
      <td>○</td><td>×</td><td>○</td>
      <td>○</td><td>×</td><td>×</td>
    </tr>
    <tr>
      <th>エスケープシーケンス (\r\n)<br>→ 効かない</th>
      <td><textarea placeholder="感想を\r\nお書き\r\nください"></textarea></td>
      <td>×</td><td>×</td><td>×</td>
      <td>×</td><td>×</td><td>×</td>
    </tr>
  </tbody>
</table>
<ul>
  <li>2016-05-08 手持ちのブラウザで確認。その方法で改行されれば「○」、改行されなければ「×」で表記。</li>
  <li>※:Chrome 48 までは有効だったことを確認・Chrome 50 では無効だった。現時点で CSS での制御が有効なのは Safari のみか。</li>
  <li>Chrome・Firefox は同じバージョンであれば Win・OSX 間で差異なし (OS によって差異がないなんて良い時代になったなぁ…)</li>
  <li>Firefox ではどの方法でも改行不可能。Chrome と IE で有効になり、コーディング方法に制約ができない実体参照での記入が一番シンプルで良さそう。</li>
</ul>
            
          
!
            
              /* Chrome 48 までは有効だった・50 では無効になった・Safari では有効 */
#ph::-webkit-input-placeholder::after {
 display:block; content:"Chrome\a改行";
}

/* Firefox・IE は同じ書き方をしても無効 */
#ph::-moz-placeholder::after {
 display:block; content:"Firefox\a改行";
}
#ph:-ms-input-placeholder::after {
 display:block; content:"IE\a改行";
}



table { border-collapse:collapse; }
td, th { border:1px solid #08f; vertical-align:top; white-space:nowrap; }
thead th { background:#def; }
tbody th { text-align:left; }
textarea { width:250px; height:3em; }
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console