HTML – Formatting

Share

HTML contains defined elements for defining how text is formatted. HTML Formatting of text borrows from the traditional Word Processing tools.

HTML Formatting Elements

Here is a summary of HTML text formatting elements.

  • <b> – Bold text
  • <strong> – Important text
  • <i> – Italic text
  • <em> – Emphasized text
  • <u> – Underlined text
  • <mark> – Marked text
  • <small> – Smaller text
  • <del> – Deleted text
  • <ins> – Inserted text
  • <s> – No longer valid text
  • <sub> – Subscript text
  • <sup> – Superscript text

Bold Text

The HTML <b> element defines the bold text, without any extra importance.

<b>This text is bold</b>

The HTML <strong> element defines text with strong importance. Visually it is typically displayed in bold.

<strong>This text is important!</strong>

Italic Text

The HTML <i> element defines text in an alternate voice or mood. Visually it is typically displayed in italic.

<i>This text is italic</i>

The HTML <em> element defines emphasized text and is typically displayed in italic.

<em>This text is emphasized</em>

Underlined Text

The HTML <u> element defines some text that is unarticulated and typically displayed underlined.

<u>This text is underlined</u>

Smaller Text

The HTML <small> element defines the text that is one font size smaller than the surrounding text.

<p>This text is <smaller>smaller</small> than the rest.</p>

Marked or Highlighted text

The HTML <mark> element defines the text that should be marked or highlighted.

<p>Do not forget to <mark>highlight</mark> your ideas.</p>

Deleted Text

The HTML <del> element defines the text that has been deleted from a document. Visually it is typically displayed with crossed-out text.

<p>The race covers <del>thirty</del> forty miles.</p>

Inserted Text

The HTML <ins> element defines a text that has been inserted into a document. Major Web browsers will typically underline inserted text.

<p>His name is Jack <ins>Murphy</ins></p>

No Longer Valid Text.

The HTML <s> element defines the text that is no longer valid in the specified context.

<p>He win a truck <s>not a sedan</s> in the competition</p>

Subscript Text

The HTML <sub> element defines subscript text. Subscript is the text that appears half a character below the normal line and is sometimes rendered in a smaller font. Subscript is ideal for formatting chemical formulas such as CO2.

<p>This is the formula for carbon dioxide CO<sub>2</sub></p>

Superscript Text

The HTML <sup> element defines superscript text. Superscript is the text that appears half a character above the normal line and is sometimes rendered in a smaller font. Superscript can be useful in scientific formulas such as 92.

<p>This is the square root of nine: 9<sup>2</sup> = 3</p>

Check out the complete list of all available HTML tags in our HTML Tag Reference.

Share