Site icon Tutorial

code Tag for Code

code Tag for Code

It is used to display programming source code on a web page. Text placed between its opening and closing tags is shown in monospaced font but for some characters like the angle brackets character entity or escape character is used so &lt for the left-angle bracket (<), and &gt for the right-angle bracket (>). It is used with <pre> tag to retain formatting as shown

HTML code

<p><code> &lt;h1&gt;This is h1

heading&lt;/h1&gt;</code></p>

Browser output

Exit mobile version