代码

基于Bootstrap显示行内嵌入的内联代码和多行代码段的文档和示例。

内联代码

<code>包裹内联代码片断,勿忘转义HTML尖括号。

示例: <section> 代码嵌入到文本段中。
示例: <code>&lt;section&gt;</code> 代码嵌入到文本段中。

代码块

使用 <pre>标签可以包裹代码块,同样HTML的尖托号需要进行义,你还可以使用 .pre-scrollable CSS样式,实现垂直滚动的效果,它默认提供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变量

推荐使用 <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> 标签代表这是一个示例。

这是一个代码示例.
<samp>这是一个代码示例.</samp>