Bootstrap Code



Bootstrap Code

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

  1. In order to show the inline code we generally use <code> tag.
  2. In order to show multiple lines inside the code then <pre> tag can be used.

Example : Bootstrap Pre Tag

Whenever we are using <pre> and <code> tags, We should use the unicode variants for the opening and closing tags i.e. &lt; and &gt;.

<pre>
&lt;html&gt;
&lt;body&gt;

&lt;h1&gt;My First Web Page&lt;/h1&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>

Output :

pre-bootstrap

Example : Bootstrap Code tag

<p><code>&lt;head&gt;</code> is head tag in the HTML.</p>

<p>We can use <code>&lt;script&gt;</code> to include JS</p>

<p><code>&lt;style&gt;</code> tag is used to include CSS</p>

Output :

code-pre-bootstrap