HTML Text Formatting

    1100655 VIEW 1 0

HTML Formatting is a process of formatting text for better look and feel. These tags are used to make text bold, italicized, or underlined. There are almost 14 options available that how text appears in HTML and XHTML.

HTML the formatting tags are two  types:

  • Physical tag: These tags are used to provide the visual appearance to the text.
  • Logical tag: These tags are used to add some logical or semantic value to the text.
Element name Description
<b> This is a physical tag, which is used to bold the text written between it.
<strong> This is a logical tag, which tells the browser that the text is important.
<i> This is a physical tag which is used to make text italic.
<em> This is a logical tag which is used to display content in italic.
<mark> This tag is used to highlight text.
<u> This tag is used to underline text written between it.
<tt> This tag is used to appear a text in teletype. (not supported in HTML5)
<strike> This tag is used to draw a strikethrough on a section of text. (Not supported in HTML5)
<sup> It displays the content slightly above the normal line.
<sub> It displays the content slightly below the normal line.
<del> This tag is used to display the deleted content.
<ins> This tag displays the content which is added
<big> This tag is used to increase the font size by one conventional unit.
<small> This tag is used to decrease the font size by one unit from base font size.

BOLD – Bold text is physical tag is used to Bold text as shown below:-

Syntax: <b> ……………………..</b>

<p><b> Hyper Institute of Technology</b> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

Italic – Italic text is physical tag is used to italicized text as shown below:-

Syntax: <i> ……………………..</i>

<p><i> Hyper Institute of Technology</i> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

Strong – This is a logical tag, which tells the browser that the text is important as shown below:-

Syntax: <strong> ……………………..</strong>

<p><strong> Hyper Institute of Technology</strong> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

Em – Em is a logical tag which is used to display content in italic.:-

Syntax: <em> ……………………..</em>

<p><em> Hyper Institute of Technology</em> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

Mark – Mark is used to highlight text as shown below:-

Syntax: <mark> ……………………..</mark>

<p><mark> Hyper Institute of Technology</mark> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

Underline – U tag is used to underline text written between it.:-

Syntax: <u> ……………………..</u>

<p><u> Hyper Institute of Technology</u> is educational website. </p>   
OUTPUT RESULTS:
Hyper Institute of Technology is educational website.

In Below the following tag and their effect :-

sup displays the content slightly above the normal line.
sub tag is the content slightly below the normal line.
del This tag is used to display the deleted content.
ins This tag displays the content which is added.
big tag is used to increase the font size by one conventional unit.
small This tag is used to decrease the font size by one unit from base font size.


H<sub>2</sub>O
10<sup>10x8</sup>
<del>Hyper Institute of Technology</del> is educational website.
<ins>Hyper Institute of Technology</ins> is educational website.
<small>Hyper Institute of Technology</small> is educational website.
<big>Hyper Institute of Technology</big> is educational website.
OUTPUT RESULTS:
H2O
1010x8
Hyper Institute of Technology is educational website.
Hyper Institute of Technology is educational website.
Hyper Institute of Technology is educational website.
Hyper Institute of Technology is educational website.