HTML Text Formatting

Formatting components were created to display a variety of different forms of text:

  • <b> - Bold text
  • <strong> - Important text
  • <i> - Italic text
  • <em> - Emphasized text
  • <mark> - Marked text
  • <small> - Smaller text
  • <del> - Deleted text
  • <ins> - Inserted text
  • <sub> - Subscript text
  • <sup> - Superscript text 

 

HTML <b> and <strong> Elements

Bold text is defined via the HTML <b> element, which has no special meaning.

<b>This text is bold</b>

Try with example

 

The HTML <strong> element designates text that has a high level of importance. The content is usually bolded on the inside.

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

Try with example 
 

HTML <i> and <em> Elements

The HTML <i> element designates a section of text that is written in a different voice or mood. Italics are commonly used to display the material inside.

Tip: The <i> tag is frequently used to denote a technical term, a phrase from another language, a thought, a ship name, and so on.

<i>This text is italic</i>

Try with example

 

Highlighted text is defined by the HTML <em> element. Italics are commonly used to display the material inside

Tip: Using vocal stress, a screen reader will pronounce the words in <em> with emphasis.

<em>This text is emphasized</em>

Try with example

 

HTML <small> Element

Smaller text is defined via the HTML <small> element:

<small>This is some smaller text.</small>

Try with example

 

HTML <mark> Element

The HTML <mark> element specifies text that should be highlighted or marked:

<p>Do not forget to buy <mark>Books</mark> today.</p>

Try with example

 

HTML <del> Element

Text that has been removed from a document is represented by the HTML<del> element. In most cases, browsers will draw a line through the erased text:

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

Try with example

 

HTML <ins> Element

A text that has been inserted into a document is defined using the HTML <ins> element. Inserted content is frequently underlined by browsers:

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

Try with example 

 

HTML <sub> Element

Subscript text is defined using the HTML <sub> element. Subscript text is half a character below the standard line, and it's often in a smaller font. Chemical formulas can be written in subscript text.

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

Try with example

 

HTML <sup> Element

Superscript text is defined using the HTML <sup> element. Superscript text is half a character above the standard line, and it's often in a smaller font. For footnotes, superscript text can be used, such as below , run and check output:

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

Try with example