Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Text Formatting

HTML Text Formatting

HTML Text Formatting

Bold text

Italic text

Computer output

This is

Subscript

and

Superscript

Try it »


HTML Formatting Tags

HTML using tags ("bold") and ("italic") to format the output text, such as:Bold or italic

These HTML tags are called formatting tags (see the complete tag reference manual at the bottom).

| Remark | Usually, the tag replaces the bold tag to use, Replacement tag instead.

 然而,这些标签的含义是不同的:       

   

  与 定义粗体或斜体文本。       

   

  或者 意味着你要呈现的文本是重要的,所以要突出显示。现今所有主要浏览器都能渲染各种效果的字体。不过,未来浏览器可能会支持更好的渲染效果。 |

| --- | --- |


Online example

Text formatting
This example demonstrates how to format text in an HTML file

Preformatted text
This example demonstrates how to use the pre tag to control blank lines and spaces.

"Computer output" tags
This example demonstrates the display effects of different "computer output" tags.

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

Abbreviations and acronyms
This example demonstrates how to implement abbreviations or acronyms.

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

Block reference
This example demonstrates how to implement quotations of varying lengths.

Deleted text and inserted text effects
This example demonstrates how to mark deleted text and inserted text.


HTML Text Formatting Tags

tag Description
Defines bold text
Defines emphasized text
Defines italic text
Defines small text
Defines strong emphasis
Defines subscript text
Defines superscript text
Defines inserted text
Defines deleted text

HTML "Computer Output" Tags

tag Description
Defines computer code
Defines keyboard input
Defines a sample of computer code
Define a variable
Defines preformatted text

HTML Quotations, Citations, and Tag Definitions

tag Description
Defines an abbreviation
Defines an address
Defines the text direction
Defines a long quotation
Defines a short quotation
Defines a quotation or citation
Defines a definition term.