HTML Text Formatting


HTML text formatting

Bold text

italic text

automatic output

This is subscript and superscript


Try It!


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 (please see the full tags reference manual at the bottom).

RemarkUsually the tag <strong> is used instead of the bold tag <b>, and the <em> is used instead of the <i> tag.

However, the meaning of these tags is different:

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

<strong> or <em> 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.



Examples

Online examples (under construction)

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.

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 quotation
This example demonstrates how to implement quotations of different lengths.

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


HTML Text Formatting Tags

TagDescription
<b>Define bold text
<em>Define text-focused
<i>Define italics
<small>Define small font
<strong>Defining to accentuate the tone
<sub>Define subscript
<sup>Define superscript
<ins>Define inserted word(s)
<del>Definition delete word(s)

HTML "Computer Output" Tag

TagDescription
<code>Define computer code
<kbd>Define keyboard code
<samp>Define computer code samples
<var>Define variables
<pre>Define pre-formatted text

HTML Citations and Tag Definitions

TagDescription
<abbr>Define abbreviations
<address>Define the address
<bdo>Define text direction
<blockquote>Define long quotations
<q>Define short quotes
<cite>Define citations
<dfn>Define a definition item