Home » HTML » HTML Code Tag

HTML Code Tag

HTML <code> tag is used to represent computer code. It defines a piece of computer code. By default, HTML Code Tag 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



Color Picker

List of color names supported by all browser »



Character Code

List of character codes to display special character »



Language Code

List of all language supported by all browser »



Country Code

List of Country code supported by all browser »

Latest Updates

PHP Introduction

How to Run a PHP program in Xampp?

How can I create a phpinfo.php page?

How to Define a Variable in PHP

PHP Echo and Print Statements

Working with PHP Operators

Understanding the PHP Data Types

How to Write Comments in PHP

How to Define a Constant in PHP

PHP if...else...elseif Statements