A text is always written to convey a message. But a style can be added to it using style attributes and other HTML formatting elements. A numerous types of font effects can be done using such elements. Lets have a look on these text types:

  • Bold

  • Important

  • Italic

  • Subscripts

  • Superscripts

  • Deleted

  • Inserted

  • Emphasized

  • Marked

  • Smallest

 

HTML Bold and Strong Elements:

<b> element is used to define the bold text and it is not applied for the highly important text.

<strong> element is used to define the strong text and it is applied for the highly important text.

Syntax

<b>This is not an important text.</b>
<strong>This is highly important text.</strong>

HTML Italic and Emphasized Elements

<i> element is used to define the text in italics and it is not applied for the highly important text.

<em> element is used to define the emphasized text and it is applied for the highly important text.

Syntax

<i>This is an example of italics text.</i>
<em>This is an example of emphasized text</em>

Please Note:

  • <b> and <i> elements are used to represent bold and italics text respectively, but<strong> and <em> elements are used for bold and italics when the text is important.
  • Browser will reflect <em> as <i> and <strong> as <b>.

 

HTML Small Element:

<small> element is used to define the small text.

Syntax

<small>Technology Diving</small>

HTML Marked Element

<mark> element is used for defining highlighted text.

Syntax

<mark>This text is a highlighted text.</mark>

HTML Deleted Element

<del> element is used to define the removed text.

Syntax

<p>
<del>Welcome to</del>
Technology Diving
</p>

HTML Inserted Element

<ins> is used for defining the added text.

Syntax

<p>
<ins>Welcome to</ins>
Technology Diving
</p>

HTML Superscript Elements

<sup> element is used for defining the super-scripted text.

Syntax

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

HTML Subscript Element

<sub> element is used for defining the sub-scripted text.

Syntax

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

A quick glance over formatting elements

  • <b>: Bold text

  • <strong>: Important text in bold

  • <i>: Italics text

  • <em>: Important text in italics

  • <small>: Small text

  • <mark>: Marked text

  • <del>: Removed text

  • <ins>: Added text

  • <sup>: Superscript text

  • <sub>: Subscript text

email