HTML Text Formatting

As you learned about the HTML style attribute, HTML also provides special elements for defining text with a special meaning. It uses tags like <b> and <i> for formatting, like bold or italic text.

HTML <b> Tag

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

<b>This is bold</b>

HTML <strong> Tag

HTML <strong> element defines strong text, with added semantic “strong” importance.
Example

<strong>This is strong</strong>

HTML <i> Tag

HTML <i> element defines italic text, without any extra importance.
Example

<i>This is italic</i>

HTML <em> Tag

HTML <em> element defines emphasized text, with added semantic importance.
Example

<em>This is emphasized</em>

HTML <small> Tag

HTML <small> element defines smaller text:
Example
<h2>This is <small>Small</small> Formatting</h2>

HTML <mark> Tag

HTML <mark> element defines marked/highlighted text:
Example

<h2>This is <mark>Marked</mark> Formatting</h2>

HTML <del> Tag

HTML <del> element defines deleted/removed text.
Example

<p>My favorite color is <del>red</del> black.</p>

HTML <ins> Tag

HTML <ins> element defines inserted/added text.
Example

<p>My favorite <ins>color</ins> is red.</p>

HTML <sub> Tag

HTML <sub> element defines subscript text.
Example

<p>This is <sub>subscript</sub> text.</p>

HTML <sup> Tag

The HTML <sup> element defines superscript text.
Example

<p>This is <sup>superscript</sup> text.</p>