Formatting is one of the crucial sections of every web development. It plays an essential role in making content attractive, readable, and appealing. Formatting can be defined as the appearance of your documentation or presentation of your HTML code in a meaningful and more beautiful way. Formatting is mainly done to make the layout attractive.



HTML provides various formatting tags. They are collectively called formatting tags as they are meant for the abovementioned purpose. So, in this chapter, you will learn about these formatting tags and how to use them.

Formatting elements in HTML were created primarily to display text in a specific way:

HTML Tag Meanings
<u> To make any text underlined.
<b> To make any text bold.
<strong> It is used in texts that are important and need to be highlighted.
<i> To make any text italic.
<em> To emphasize any text.
<mark> To make any text marked or highlighted.
<small> To make the text smaller in size than other regular text.
<big> To make the text bigger in size than other regular text.
<del> To show the text that has been removed or replaced.
<ins> To show the text that has been added.
<sub> To give a subscript effect to any text.
<sup> To give a superscript effect to any text.
<strike> To display any text as a strikethrough.
<tt> For displaying any font as a monospaced font. This tag is abbreviated as a typewriter font tag.Let's check this out by using an example program:

Example:

<!DOCTYPE html>
<html>

    <head>
        <title>Formatting elements example</title>
    </head>
    <body>
        This makes ur <u> text </u> underlined <br />
        This is a <b> bold </b> man <br />
        This is a <strong> Strong </strong> creature <br />
        I stands for <i> italics </i> <br />
        This will <em> emphasize </em> your text <br />
        This will <mark> highlight </mark> your word <br />
        This is a <small> small </small> island <br />
        This is a <big> Big </big> river <br />
        I want red color, not <del> green </del> <br />
        Please insert <ins> THIS </ins> instead of THAT <br />
        H<sub> 2 </sub> O <br />
        x <sup> 3 </sup> <br />
        I want red color, not <strike> green </strike> <br />
        This is a <tt> different </tt> font
    </body>

</html> 

Click on the "Run Code" button above to see how the code works.



Found This Page Useful? Share It!
Get the Latest Tutorials and Updates
Join us on Telegram