Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <code> tags


May 04, 2021 HTML Reference Manual


Table of contents


HTML and code.gt; tags

The tag features include turning the text into an equal-width font and suggesting that the text is the source code.

Format the text in the document:

<code>一段电脑代码</code>

Try it out . . .

Browser support

HTML <code> tags HTML <code> tags HTML <code> tags HTML <code> tags HTML <code> tags

All major browsers support the label.


Label definition and instructions for use

A label is a phrase tag that defines computer code text.

Tip: We're not against using this label, but if you're using it just to achieve some visual effect, we recommend using CSS, which might lead to richer results.

All phrase tags:

标签 描述
<em> 呈现为被强调的文本。
<strong> 定义重要的文本。
<dfn> 定义一个定义项目。
<code> 定义计算机代码文本。
<samp> 定义样本文本。
<kbd> 定义键盘文本。它表示文本是从键盘上键入的。它经常用在与计算机相关的文档或手册中。
<var> 定义变量。您可以将此标签与 <pre>及 <code> 标签配合使用。


The difference between HTML 4.01 and HTML5

No.


Global properties

Labels support the global properties of HTML.


The event property

The tag supports the event properties of HTML.


Related articles

HTML tutorial: HTML text formatting