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

<pre>
<html>
<body>
<h1>My First Web Page</h1>
</body>
</html>
</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