HTML Text Formatting


HackerThink Bold text

Italic text

Computer code

This is the subscript and superscript

HTML formatting tags

HTML uses tags <b>(“bold”) and <i>(“italic”) to format the output text, such as bold or italic

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

Usually the tag replaces the bold tag to use, and the replaces the tag to use.

However, the meaning of these tags is different:

<b> and <i> define bold or italic text.

or means that the text you want to present is important, so highlight it. All major browsers today can render fonts with various effects. However, future browsers may support better rendering effects.

Online examples

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” label
This example demonstrates the display effects of different “computer output” labels.

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 quotes
This example demonstrates how to implement quotes of varying lengths.

Delete word effect and insert word effect
This example demonstrates how to mark deleted text and inserted text.

HTML text formatting tags

Label Description
Define bold text
Define text-focused
Define italics
Define small font
Defining strong font
Define subscript words
Define superscript words
Define inserted words
Definition delete word

HTML “computer output” tag

Label Description
Define computer code
Define keyboard code
Define computer code samples
Define variables
Define pre-formatted text

HTML citations, quotes, and tag definitions

Label Description
Define abbreviations
Define address
<bdo> 定义文字方向
Define text direction
Define short quotes
Define citations, citations
Define a definition item.