HTML Formatting

HTML

Following are the most common formatting used in HTML.

Bold

To make a text bold we use the <b> tag.

<p>This text is in <b>bold</b> format.</p>

Output

This text is in bold format.

Italic

To make a text italic we use the <i> tag.

<p>This text is in <i>italic</i> format.</p>

Output

This text is in italic format.

Underline

To make a text underline we use the <u> tag.

<p>This text is in <u>underline</u> format.</p>

Output

This text is in underline format.

Subscript

To make a text subscript we use the <sub> tag.

<p>This text is in <sub>subscript</sub> format.</p>

Output

This text is in subscript format.

Superscript

To make a text superscript we use the <sup> tag.

<p>This text is in <sup>superscript</sup> format.</p>

Output

This text is in superscript format.

Address

To denote address we use the <address> tag.

<address>
#123 HSR Sector 2, 37th Main road, Random Address, Bangalore
Pincode 560001 India
</address>

Output

#123 HSR Sector 2, 37th Main road, Random Address, Bangalore Pincode 560001 India

Strikethrough

To make a text strikethrough we use the <strike> tag.

<p>This text is in <strike>strikethrough</strike> format.</p>

Output

This text is in strikethrough format.

Deleted text

To make a text deleted we use the <del> tag.

<p>This text is in <del>deleted</del> format.</p>

Output

This text is in deleted format.

Inserted text

To make a text inserted we use the <ins> tag.

<p>This text is in <ins>inserted</ins> format.</p>

Output

This text is in inserted format.

Smaller text

To make a text smaller we use the <small> tag.

<p>This text is in <small>small</small> format.</p>

Output

This text is in small format.

Bigger text

To make a text bigger we use the <big> tag.

<p>This text is in <big>big</big> format.</p>

Output

This text is in big format.

Mark text

To mark text we use the <mark> tag.

<p>This text is in <mark>mark</mark> format.</p>

Output

This text is in mark format.

Emphasized text

To emphasized text we use the <em> tag.

<p>This text is in <em>emphasized</em> format.</p>

Output

This text is in emphasized format.

Strong text

To make a strong (important) text we use the <strong> tag.

<p>This text is in <strong>strong</strong> format.</p>

Output

This text is in strong format.

Abbreviation

To create abbreviation of a text we use the <abbr> tag.

<p>We are learning <abbr title="Hyper Text Markup Language">HTML</abbr>.</p>

Output

We are learning HTML.

Acronym

To denote acronym we use the <acronym> tag.

<p>Indian Space Research Organisation or <acronym>ISRO</acronym></p>

Output

Indian Space Research Organisation or ISRO

Blockquote

To denote quote we use the <blockquote> tag.

<p><blockquote>I hated every minute of training, but I said, &aposDon&apost quit. Suffer now and live the rest of your life as a champion.&apos

- Muhammad Ali</blockquote> </p>

Output

I hated every minute of training, but I said, 'Don't quit. Suffer now and live the rest of your life as a champion.'
- Muhammad Ali

Code

To denote code we use the <code> tag.

<code><?php echo "Hello World!" ?></code>

Output

<?php echo "Hello World!" ?>

Code Variable

To denote variable of a program we use the <var> tag.

int <var>age</var> = 10;

Output

int age = 10;

Code Output

To denote code output we use the <samp> tag.

<samp>Hello World!</samp>

Output

Hello World!

Keyboard

To denote keyboard input we use the <kbd> tag.

<p>Type the <kbd>i</kbd> key to enter INSERT MODE in vi using terminal.</p>

Output

Type the i key to enter INSERT MODE in vi using terminal.

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT