English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
In this chapter, we will learn about HTML text formatting, that is, to add formatting to plain text
<strong>Bold text(oldtoolbag.com)</strong> <br/><i>Italic text,w3codebox basic tutorial</i> <br/><code>Code is automatically output</code> <br/>This is element X<sub>subscript</sub>and X<sup>superscript</sup> <br/>Chemical molecular formula: <b>C<sub>7</sub>H<sub>7</sub>F<sub>2</sub>N</b>Test to see ‹/›
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 (please see the complete tag reference manual at the bottom).
The <strong> tag usually replaces the bold tag <b> to use, so it is recommended to use <strong> , <em> replaces the use of the <i> tag. However, the meanings of these tags are different: <b> and <i> define bold or italic text. |
Ordinary text formatting
This example demonstrates how to format ordinary text in an HTML file.
Preformatted text
This example demonstrates how to use the pre tag to control empty lines and spaces.
"Computer output" tags
This example demonstrates the display effects of different "computer output" tags.
Address
This example demonstrates how to write addresses in an HTML file.
Abbreviations and initials
This example demonstrates how HTML implements abbreviations or initials.
Text direction
This example demonstrates how HTML changes the direction of text.
Block quote
This example demonstrates how HTML implements quotes of different lengths.
Deleted text effect and inserted text effect
This example demonstrates how HTML marks deleted text and inserted text.
Label | Description |
<b> | Define bold text |
<em> | Define emphasized text |
<i> | Define italic text |
<small> | Define small text |
<strong> | Define emphasized tone |
<sub> | Define subscript text |
<sup> | Define superscript text |
<ins> | Define inserted text |
<del> | Define deleted text |
Label | Description |
<code> | Define computer code |
<kbd> | Define keyboard code |
<samp> | Define computer code sample |
<var> | Define variable |
<pre> | Define preformatted text |
Label | Description |
<abbr> | Define abbreviation |
<address> | Define address |
<bdo> | Define text direction |
<blockquote> | Define a long quote |
<q> | Define a short quote |
<cite> | Define a reference or citation |
<dfn> | Define a definition item. |