Latest web development tutorials

HTML text formatting

HTML text formatting

加粗文本

斜体文本

电脑自动输出

这是 下标 上标

try it"

HTML formatting tags

Use HTML tags <b> and <i> output text format, such as:bold or italic

These HTML tags are called formatting tags (see the bottom of the label complete reference manual).

RemarkTypically tag <strong> Replace the bold tag <b> use, <em> replace <i> tag to use.

However, the meaning of these labels are different:

<B> bold or italic text with <i> definition.

<Strong> or <em> means that you have to render the text is important, so you want to highlight. Today all major browsers render various effects in the font. However, future browsers might support better rendering.


Examples

Online examples

Text Formatting
This example demonstrates how the HTML file in a text format

Preformatted text
This example demonstrates how to use the pre tags blank lines and spaces controlled.

"Computer Output" Tags
This example demonstrates the effect of displaying different "computer output" tags.

address
This example demonstrates how to write the address in the HTML file.

Abbreviations and acronyms
This example demonstrates how to implement an abbreviation or acronym.

Text Direction
This example demonstrates how to change the direction of the text.

Block quote
This example demonstrates how to implement different lengths of quotation.

Delete the word insert effects and effect of the word
This example demonstrates how to insert text and delete text tags.


HTML text formatting tags

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

HTML "Computer Output" Tags

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

HTML citations, references, and label definitions

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