HTML Text Formatting

HTML Tutorial

HTML Text Formatting

Completed

Text Formatting

This text is bold

This text is italic

This is subscript and superscript


Try it Yourself

HTML Formatting Elements

Completed

when you studied the previous chapter, you came to know about the HTML style attribute.

HTML also has special elements which defines text with a special meaning.

HTML utilises elements like <b> and <i> inorder to format output, like bold or italic text.

Formatting elements were made for displaying special types of text:

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

HTML and Elements

Completed

The HTML <b> element is used to define bold text, without giving any extra importance.

Example

<b>This text is bold</b>
Try it Yourself

The HTML <strong> element is used to define strong text, by adding semantic "strong" importance.

Example

<strong>This text is strong</strong>
Try it Yourself

HTML and Elements

Completed

The HTML <i> element is used to define italic text, without having any extra importance.

Example

<i>This text is italic</i>
Try it Yourself

The HTML <em> element is used to define emphasized text, by adding semantic importance.

Example

<em>This text is emphasized</em>
Try it Yourself

HTML Element

Completed

The HTML <small> element is used to define smaller text:

Example

<h2>HTML <small>Small</small> Formatting</h2>
Try it Yourself

HTML Element

Completed

The HTML <mark> element is used to define marked or highlighted text:

Example

<h2>HTML <mark>Marked</mark> Formatting</h2>
Try it Yourself

HTML Element

Completed

The HTML <del> element is used to define deleted (removed) text.

Example

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

HTML Element

Completed

The HTML <ins> element is used to define inserted (added) text.

<p>My favorite <ins>color</ins> is red.</p>
Try it Yourself

HTML Element

Completed

The HTML <sub> element is utilised for defining subscripted text.

<p>This is <sub>subscripted</sub> text.</p>
Try it Yourself

HTML Element

Completed

The HTML <sup> element is used to define superscripted text.

<p>This is <sup>superscripted</sup> text.</p>
Try it Yourself

Test Yourself with Exercises

Completed

HTML Text Formatting Elements

Completed

Tag Description
<b> Defines bold text
<em> Defines emphasized text 
<i> Defines italic text
<small> Defines smaller text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<mark> Defines marked/highlighted text