HTML FORMATING ELEMENTS


We use given below elements to formatting the html.

Italic and Bold: <i> <em> <b> <strong>

Underline: <u>

Big and Small: <big> <small>

Highlighted: <mark>

Subscript & Superscript: <sub> <sup>

Inserted & Deleted: <ins> <del>


Italic Text

<i> makes the text italic; <em> does the same thing.

The difference is that <em> emphasises importance

He said <i> I am just going outside and may be some time </i>.

If you don't have a vaccination <em> you may catch malaria and die </em>.


Bold Text

<b> makes the text bold; <strong> does the same thing.

The difference is that <strong> emphasises importance.

She said <b> If you want something said, ask a man; if you want something done, ask a woman </b> .

If you can't repay your mortgage <strong> you may lose your home </strong>.


Underline

<u> makes the text underline

The viewer <u> may be confused </u> if you use underline.

Her name is <u> Cheng </u> Sin Ying.


Big and Small Text

<big> and <small> do exactly what you expect.

However, <big> is not part of the latest HTML standard.

It's dangerous to use <big> big </big> because it isn't part of HTML 5!

I'm embarrassed to say it loudly so here it is: <small> I love you! </small>


Highlilghting Text

<mark> highlights the text

Send us your bank details and you may become a <mark> millionaire </mark>!


Subscript and Superscript

<sub> and <sup> are used for offsetting

If x <sub>1 </sub> = 2 and x <sub>2 </sub> = 4 then x <sub> 1 </sub> <sup> 2 </sup> + x <sub> 2 </sub> <sup>3 </sup> equals 68

Some video streaming may use XML1

1 G. Lam & D. Rossiter, 'A Web Service Framework Supporting Multimedia Streaming', IEEE Transactions on Services Computing, 2013


Inserted and Deleted Text

<ins> and <del> are used for showing edits

Let's do this edit: Prof. Rossiter is <ins> truly </ins> the most intelligent.

Also this: Prof. Rossiter has an <del> astonishingly </del> old car.



EXAMPLE CODE - HTML FORMATING ELEMENTS

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Formating Elements</title>
</head>
<body>

<h3>Italic Text</h3>
<i> I am just going outside and may be some time </i>.

<h3>Bold Text</h3>
<b> If you want something said, ask a man; if you want something done, ask a woman </b>
<strong> you may lose your home </strong>

<h3>Underline</h3>
<u> My name is Cheng </u>

<h3>Big and Small Text</h3>
<big> big </big>
<small> I love you! </small>

<h3>Highlilghting Text</h3>
<mark> millionaire </mark>

<h3>Subscript and Superscript</h3>
x <sub>1</sub> = x <sup>1</sup>

<h3>Inserted and Deleted Text</h3>
Let's do this edit: Prof. Rossiter is <ins> truly </ins> the most intelligent. Also this: Prof. Rossiter has an <del> astonishingly </del> old car.

</body>
</html>

Copy above code & try it into your natepad


Browser view of the code:

Html Formating Elements



Copyright © 2020. All rights reserved.