Bootstrap – Code

Bootstrap - Code

Bootstrap allows you to display code with two different key ways −

  • The first is the <code> tag. If you are going to be displaying code inline, you should use the <code> tag.
  • Second is the <pre> tag. If the code needs to be displayed as a standalone block element or if it has multiple lines, then you should use the <pre> tag.

Make sure that when you use the <pre> and <code> tags, you use the unicode variants for the opening and closing tags − &lt; and &gt;.

Let us see an example below −

<p><code>&lt;header&gt;</code> is wrapped as an inline element.</p>
<p>To display code as a standalone block element use &lt;pre&gt; tag as:</p>

<pre>
   &lt;article&gt;
      &lt;h1&gt;Article Heading&lt;/h1&gt;
   &lt;/article&gt;
</pre>

Next Topic : Click Here

This Post Has One Comment

Leave a Reply