コード

Bootstrap でインラインおよび複数行のコードブロックを表示するためのドキュメントとサンプルです。

インラインコード

コードのインラインスニペットは <code> で囲んでください。HTML の山カッコはエスケープが必要です。

For example, <section> should be wrapped as inline.
For example, <code>&lt;section&gt;</code> should be wrapped as inline.

コードブロック

複数行のコードには <pre> を使います。くり返しますが、正しくレンダリングするために、コード中の山カッコをエスケープしてください。.pre-scrollable クラスを指定すると、max-height が 350px になり、y軸のスクロールバーが表示されます。

<p>Sample text here...</p>
<p>And another line of sample text here...</p>
<pre><code>&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;And another line of sample text here...&lt;/p&gt;
</code></pre>

変数

変数を示すには <var> タグを使います。

y = mx + b
<var>y</var> = <var>m</var><var>x</var> + <var>b</var>

ユーザ入力

<kbd> を使って、一般的にはキーボードでなされる入力であることを示します。

To switch directories, type cd followed by the name of the directory.
To edit settings, press ctrl + ,
To switch directories, type <kbd>cd</kbd> followed by the name of the directory.<br>
To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd>

サンプル出力

プログラムからの出力例を示すには <samp> タグを使います。

This text is meant to be treated as sample output from a computer program.
<samp>This text is meant to be treated as sample output from a computer program.</samp>