This article mainly describes the use of HTML code tag interpretation, and HTML code tag usage examples, and finally a code tag summary. Let's take a look at this article next.
First, let's take a look at the HTML code tag usage explanation:
<code> tags are used to indicate computer source code or text content that can be read by other machines.
Software code writers have become accustomed to the special style of text representation when writing source code. <code> tags are designed for them. The text contained within the label will be displayed with a wide, typewriter-like font (Courier), which should be familiar to most programmers and w3school users.
The <code> tag should be used only on text content that represents the source code of the computer program or that other machines can read. Although the <code> tag usually only turns text into equal-width fonts, it implies that the text is the source code. Future browsers may add additional display effects. For example, a programmer's browser might look for a <code> fragment and perform some extra text formatting, such as looping and conditional judgment statements for special indentation, and so on.
Tip: If you just want to use the effect of the equal-width font, use the <tt> tab. Or, if you want to display programming code in text that is strictly restricted to equal-width font formatting, use the <pre> tag.
Small examples of the use of HTML code tags:
Code tags and pre tags can be nested using
<pre> <code> Hello World </code></pre>
This expression is very simple, let's take a look at:
The effect is very simple, that is, the text is on it, let's take a look at the use of this example explanation:
The code tag should be applied only to text content that represents the source code of a computer program or that other machines can read. <code> tags have the function of turning text into equal-width fonts, and a feature that implies that the text is the source code. Then, depending on the second feature, the browser may be able to add an effect to your situation in the future. For example, a programmer's browser might look for a <code> fragment and perform some extra text formatting, such as looping and conditional judgment statements for special indentation, and so on.
Summary of HTML code tags:
The code element in HTML, the content that is written in the code element (a language that is generally considered HTML) is not processed by the browser as an HTML language, but instead is considered to be text and is displayed independently as a source form with angle brackets.
Well, the above is the explanation of the introduction and function of the HTML code tag (want to see more about the HTML tag introduction and course, welcome to topic.alibabacloud.com), in doubt can leave a message below.