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;.


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


Output :


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 :