1. Text Formatting Tags

Text formatting tags are used to change the appearance and importance of text in HTML.

1.1 Bold Text (<b>)

Definition

The <b> tag makes the text bold without giving any extra importance.

Syntax

<b>Bold Text</b>

Example

<p>This is <b>important</b> text.</p>

Output

This is important text.

1.2 Strong Text (<strong>)

Definition

The <strong> tag shows strong importance and is also bold by default.

Syntax

<strong>Strong Text</strong>

Example

<p>This is <strong>very important</strong> text.</p>

output:

This is very important text.

1.3 Italic Text (<i>)

Definition

The <i> tag makes text italic.

Syntax

<i>Italic Text</i>

1.4 Emphasized Text (<em>)

Definition

The <em> tag emphasizes text and is important for screen readers.

Syntax

<em>Emphasized Text</em>

1.5 Underline Text (<u>)

Definition

The <u> tag underlines text.

Syntax

<u>Underlined Text</u>

1.6 Highlight Text (<mark>)

Definition

The <mark> tag highlights text.

Syntax

<mark>Highlighted Text</mark>

1.7 Small Text (<small>)

Definition

The <small> tag displays smaller text.

1.8 Superscript (<sup>)

Example

x<sup>2</sup>

Output: 

1.9 Subscript (<sub>)

Example

H<sub>2</sub>O

Output: 

H₂O

Summary Table

TagPurpose
<b>Bold
<strong>Important text
<i>Italic
<em>Emphasis
<u>Underline
<mark>Highlight
<small>Small text
<sup>Superscript
<sub>Subscript