The HTML tag represents a fragment of computer code.
The code fragment could be an XML element name, a filename, a computer program, or any other string that a computer would recognize.
Browsers usually display </code> content in a monospace font (also called a fixed-width or non-proportional font) such as Courier (unless style sheets have been used to specify a different font).
The tag is written as
</code>
with the code fragment inserted between the start and end tags.
A common usage of the is to display HTML code within a web page. To display HTML code, you need to use the correct HTML entities to ensure the HTML code is actually displayed (and not rendered) by the browser.
Specifically, you need to use <
in place of the less-than symbol (<
) and >
in place of the greater-than symbol (>
).
Multiple lines of code can be marked up by surrounding the tags with
<pre>
tags.
There is no formal way to specify the langauge of the computer code contained within the tags. The HTML specification recommends specifying the language using the
class
attribute. For example, by using a prefix such as language-
to the class name.