HTML Text Formatting Tags

Text Formatting Tags

There are tags in HTML which can be used to change or add styles to the text which appears in the web page.

These tags are collectively called Text Formatting tags.

The Text Formatting tags are explained below,


<b> Tag (Bold)

Text to be Bold are written inside the <b> and </b> tags.

Syntax

<b>Your text</b>

Example

Try Yourself

<i> Tag (Italic)

Text to be made italic are written inside the <i> and </i> tags.

Syntax

<i>Your text</i>

Example

Try Yourself

<u> Tag (Underline)

Text to be underlined are written inside the <u> and </u> tags.

Syntax

<u>Your text</u>

Example

Try Yourself

<strong> Tag

This tag will bold and increase the font size of the given text, text should be written inside the <strong> and </strong> tags.

Syntax

<strong>Your text</strong>

Example

Try Yourself

<em> Tag (Emphasized text)

The <em> tag is a phrase tag. It renders the given as important.

This tag output is similar to <i> tag

Syntax

<em>Your text</em>

Example

Try Yourself

<mark> Tag

This tag is used to mark the specific text in a sentence or paragraph.

When you write text inside the <mark> tag, it will mark it with yellow color.

Syntax

<mark>Your text</mark>

Example

Try Yourself

<small> Tag

Reduce the font size of the given text.

Syntax

<small>Your text</small>

Example

Try Yourself

<del> Tag (Delete)

This will display the text in deleted format, such as a line will be crossed over the given text.

Usually this is used to specify the discount price.

Syntax

<del>Your text</del>

Example

Try Yourself

<ins> Tag

Its output is similar to <u> tag.

Syntax

<ins>Your text</ins>

Example

Try Yourself

<sup> Tag (superscripted)

This tag is defined as superscripted text.

We can use this for denoting chemistry or maths formula which has power values, like C2.

Syntax

<sup>Your text</sup>

Example

Try Yourself

<sub> Tag (subscripted )

This tag is defined as subscripted text.

We can use this for chemistry or maths formula which has base value, like log10.

Syntax

<sub>Your text</sub>

Example

Try Yourself