Html Formatting

Like in word processor, we can format our text blod, italic, underline, etc. in HTML also.

In HTML we use elements <b>, <i> and <u> for formatting output, like bold, italic and underline text.

Bold Text

Text that appears within <b>…</b> element, will displayed in bold:

<html>
<head>
<title>Bold Text Example</title>
</head>
<body>
<p>This is an example of <b>bold</b> in html.</p>
</body>
</html>

Italic Text

Text that appears within <i>…</i> element, will displayed in italic:

<html>
<head>
<title>Italic Text Example</title>
</head>
<body>
<p>This is an example of <i>Italic</i> in html.</p>
</body>
</html>

Underlined Text

Text that appears within <u>…</u> element, will get Underlined:

<html>
<head>
<title>Underlined Text Example</title>
</head>
<body>
<p>This is an example of <u>Underlined text</u> in html.</p>
</body>
</html>

Emphasized Text

Text that appears within <em>…</em> element, will get Emphasized:

<html>
<head>
<title>Emphasized Text Example</title>
</head>
<body>
<p>This is an example of <em>Emphasized text</em> in html.</p>
</body>
</html>

Small Text

Text that appears within <small>…</small> element, will get formatted as below in example:

<html>
<head>
<title>Small Text Example</title>
</head>
<body>
<p>This is an example of <small>Small text</small> in html.</p>
</body>
</html>

Strike Text

Text that appears within <strike>…</strike> element, will appear with strikethrough:

<html>
<head>
<title>Strike Text Example</title>
</head>
<body>
<p>This is an example of <strike>Small text</strike> in html.</p>
</body>
</html>

Superscript Text

Text that appears within <superscript>…</superscript> element, will written in superscript:

<html>
<head>
<title>Superscript Example</title>
</head>
<body>
<p>This is an example of <sup>Superscript text</sup> in html.</p>
</body>
</html>

Subscript Text

Text that appears within <subscript>…</subscript> element, will written in subscript:

<html>
<head>
<title>Subscript Example</title>
</head>
<body>
<p>This is an example of <sub>Subscript text</sub> in html.</p>
</body>
</html>

Mark Text

Text that appears within <mark>…</mark> element, will get marked OR highlighted:

<html>
<head>
<title>Mark Example</title>
</head>
<body>
<p>This is an example of <mark>Mark text</mark> in html.</p>
</body>
</html>

Deleted Text

Text that appears within <del>…</del> element, is displayed as deleted(removed) text:

<html>
<head>
<title>Del Example</title>
</head>
<body>
<p>This is an example of <del>Deleted text</del> in html.</p>
</body>
</html>

Inserted Text

Text that appears within <ins>…</ins> element, is displayed as inserted(added) text:

<html>
<head>
<title>Ins Example</title>
</head>
<body>
<p>This is an example of <ins>Deleted text</ins> in html.</p>
</body>
</html>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.