English 中文(简体)
Bootstrap Tutorial

Bootstrap with CSS

Bootstrap Layout Components

Bootstrap Plugins

Bootstrap Demos

Bootstrap Useful Resources

Selected Reading

Bootstrap - Code
  • 时间:2024-11-03

Bootstrap - Code


Previous Page Next Page  

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 inpne, 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 pnes, 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 inpne 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>