HTML Text Formatting

Bold

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

The HTML <strong> element defines strong text, with added semantic "strong" importance.

HTML Code:

<b>This text is bold</b> <strong>This text is strong</strong>

Result:

This text is bold

This text is strong


Italic

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

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

HTML Code:

<i>This text is italic</i> <em>This text is emphasized</em>

Result:

This text is italic

This text is emphasized


Small

The HTML <small> element defines smaller text.

HTML Code:

<h2>HTML <small>Small</small> Formatting</h2>

Result:

HTML Small Formatting


Mark

The HTML <mark> element defines marked or highlighted text.

HTML Code:

<h2>HTML <mark>Marked</mark> Formatting</h2>

Result:

HTML Marked Formatting


Del

The HTML <del> element defines deleted (removed) text.

HTML Code:

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

Result:

My favorite color is blue red.


Ins

The HTML <ins> element defines inserted (added) text.

HTML Code:

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

Result:

My favorite color is red.


Sub - Sup

The HTML <sub> element defines subscripted text.

The HTML <sup> element defines superscripted text.

HTML Code:

<p>This is <sub>subscripted</sub> text.</p> <p>This is <sup>superscripted</sup> text.</p>

Result:

This is subscripted text.

This is superscripted text.

HTML Index

References

  1. W3Schools

This page is only a summary of the material from W3Schools. Definitions, Examples and Codes are exclusive property of W3Schools.