HTML Code Tag is used to classify a snippet of computer code within an HTML resource or webpage.
We can also say that whenever we want the browser to distinctively identify a piece of computer code we wrap the snippet of the code in the Code Tag.
HTML Code Tag Syntax
<code> Some Computer Code here.. </code>
HTML Code Tag Example
HTML Code Tag Code | Output |
Below is the code of a function to square a number <code> number Function square(number) { Var Result; Result = number*number; Return result; } </code> |
Below is the code of a function to square a number
|
In the HTML Code Tag example above we can see that the sample function code to square a number is being rendered in a different format than the text neighboring it this is how the Code Tag differentiates between the normal text and text within the HTML Code Tag.
HTML Code Tag Support all HTML Global Attributes and HTML Event Attributes.
HTML Code Tag Supporting Browsers
S. No. | Browser | Supported(Yes/No) |
1 | Internet Explorer | Yes |
2 | Firefox | Yes |
3 | Google Chrome | Yes |
4 | Opera | Yes |
5 | Safari | Yes |