HTML text formatting


May 02, 2021 11:07 HTML


Table of contents


HTML text formatting

There are labels in HTML that format text that can be used directly without you having to write style adjustments.

<b>加粗文本</b><br><br>

<i>斜体文本</i><br><br>

<code>电脑自动输出</code><br><br>

这是 <sub> 下标</sub> 和 <sup> 上标</sup>


Try it out . . .

HTML formats labels

HTML formats the text of the output using the labels .lt;b>("bold") and "italic") for the output, such as: bold or italics

These HTML tags are called formatted labels (see the full label reference manual at the bottom).

HTML text formatting Usually the label is replaced with the bold label and the label is used, and the label is replaced by the label.
However, the meaning of these labels is different:
Define bold or italic text with .lt;i.gt.
The meaning of the text you want to render is important, so highlight it.
All major browsers today render fonts with a variety of effects. However, browsers may support better rendering in the future.

HTML text formatting

An example of this site

The text is formatted
This example shows how to format text in an HTML file

Preformed text
This example shows how to use the pre label to control empty lines and spaces.

Computer Output label
This example shows how different Computer Output labels look.

Address
This example shows how to write an address in an HTML file.

Abbreviations and abbreviations
This example shows how to implement abbreviations or abbreviations.

The direction of the text
This example shows how to change the direction of the text.

Block reference
This example shows how to implement references of different lengths.

The Delete Word effect and the Insert Word effect
This example shows how to mark deleted and inserted text.


HTML text formats labels

标签 描述
<b> 定义粗体文本
<em> 定义着重文字
<i> 定义斜体字
<small> 定义小号字
<strong> 定义加重语气
<sub> 定义下标字
<sup> 定义上标字
<ins> 定义插入字
<del> 定义删除字


HTML "Computer Output" label

标签 描述
<code> 定义计算机代码
<kbd> 定义键盘码
<samp> 定义计算机代码样本
<var> 定义变量
<pre> 定义预格式文本


HTML citations, references, and label definitions

标签 描述
<abbr> 定义缩写
<address> 定义地址
<bdo> 定义文字方向
<blockquote> 定义长的引用
<q> 定义短的引用语
<cite> 定义引用、引证
<dfn> 定义一个定义项目。