Responsive Advertisement

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 −

<!DOCTYPE html>
<html>
<head>
<title>Try v1.2 Bootstrap Online</title>
<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="/scripts/jquery.min.js"></script>
<script src="/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>

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

</body>
</html>

<header> is wrapped as an inline element.
To display code as a standalone block element use <pre> tag as:

 <article>
<h1>Article Heading</h1>
</article>

 

Post a Comment

0 Comments