Easy Tutorial
❮ Bootstrap List Group Bootstrap V2 Images ❯

Bootstrap Code

Bootstrap allows you to display code in two ways:

Make sure that when you use the <pre> and <code> tags, the opening and closing tags use the unicode variants: < and >.

Let's look at the following example:

Example

<p><code>&lt;header&gt;</code> is surrounded as an inline element.</p>
<p>If you need to display code as a standalone block element, use the &lt;pre&gt; tag:</p>
<pre>
    &lt;article&gt;
        &lt;h1&gt;Article Heading&lt;/h1&gt;
    &lt;/article&gt;
</pre>

The example is shown as follows:


More Examples

Element/Class Description Example
<var> Variable assignment: x = a + b y Try it
<kbd> Key prompt: CTRL + P Try it
<pre> Multi-line code Try it
<pre class="pre-scrollable"> Multi-line code with scrollbar Try it
<samp> Computer program output: Sample output Try it
<code> Inline code snippet: span, div Try it
❮ Bootstrap List Group Bootstrap V2 Images ❯