HTML Code Elements

HTML <code> tag is used to represent computer code. It defines a piece of computer code. By default, it is displayed in the browser's default monospace font.

HTML Code Tag


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Code Tag </title>
</head>
<body>
<em>Emphasized text</em><br>
<strong>Strong text</strong><br>
<code>A piece of computer code</code><br>
<samp>Sample output from a computer program</samp><br>
<kbd>Keyboard input</kbd><br>
<var>Variable</var>
</body>
</html>

Output

HTML Code Tag Examples Emphasized text
Strong text
A piece of computer code
Sample output from a computer program
Keyboard input
Variable

HTML Code Tag

The code tag is a phrase tag that defines a piece of computer code.

Tags Description
<code> It defines a piece of computer code.
<kbd> It defines keyboard input.
<samp> It specifies a sample output from a computer program.
<pre> Defines preformatted text.
<dfn> It defines a definition term.
<var> It defines a variable.
<strong> It defines a important text.

Browser Support

Element
Microsoft Edge browser.png Edge
Chrome browser.png Chrome
Firefox browser.png Firefox
Opera browser.png Opera
safari browser.png Safari
<code>
Yes
Yes
Yes
Yes
Yes








Become a Patron!

Note: If the updated content is not visible to you please refresh the cookies by pressing CTRL + Shift + R.