Bootstrap 内联和多行代码块的显示文档和示例。

内联代码

<code> 包装内联代码片段。务必转义 HTML 尖括号。

例如,<section> 应作为内联包装。
For example, <code>&lt;section&gt;</code> should be wrapped as inline.

代码块

使用 <pre>s 表示多行代码。同样,务必转义代码中的所有尖括号以正确呈现。您可以选择添加 .pre-scrollable 类,它将设置 340px 的最大高度并提供一个 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>