HTML <code> tag

HTML <code> tag : Definition

• The HTML <code> tag is used to insert variables, fragments of program code, etc. into an HTML document.

• The content inside is displayed in the browser's default monospace font.

• The <code> tag alone represents a single code line or code phrase.

• It should be wrapped within a <pre> element for representing several lines of code.



<code> tag example :


<!DOCTYPE html>
<html>
  <head>
    <title>Html code tag example</title>
  </head>
  <body>
    <p>This is a normal paragraph text.</p>
    <code>This is Line of program code.</code>
    <p>This is also a normal paragraph text.</p>
  </body>
</html>  






OUTPUT :


  

This is a normal paragraph text.

This is Line of program code.

This is also a normal paragraph text.