使用 Bootstrap 顯示內嵌和多行程式碼區塊的文件和範例。

內嵌程式碼

使用 <code> 包住內嵌程式碼片段。請務必跳脫 HTML 尖括號。

例如,<section> 應包為內嵌。
For example, <code>&lt;section&gt;</code> should be wrapped as inline.

程式碼區塊

對多行程式碼使用 <pre>。同樣地,請務必跳脫程式碼中的任何尖括號以正確呈現。您可以選擇性地新增 .pre-scrollable 類別,這將設定最大高度為 340 像素並提供 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> 來表示通常透過鍵盤輸入的輸入。

若要切換目錄,請輸入 cd,後接目錄名稱。
若要編輯設定,請按 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> 標籤。

這段文字應視為電腦程式範例輸出。
<samp>This text is meant to be treated as sample output from a computer program.</samp>