Formatting is one of the crucial sections of every development. To make an article or content look attractive, readable, and user-intractable, formatting plays a significant role. 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 because they are meant for the purpose mentioned above. So, in this chapter, you will learn about these formatting tags and how to use them.
Formatting elements in HTML were mainly created for displaying texts of a special type:
|<u>||For making text underlined.|
|<b>||For making the text Bold.|
|<strong>||Used in those texts, which are important and need to highlight.|
|<i>||For making the text italics.|
|<em>||For emphasizing the texts.|
|<mark>||To make the texts marked or highlighted.|
|<small>||For making texts small in size, then the regular texts surrounded.|
|<big>||For making texts bigger or larger, then the rest of the texts are surrounded.|
|<del>||To show texts that have been deleted or removed or replaced.|
|<ins>||To show texts that have been inserted or added|
|<sub>||To give a subscript effect to any text.|
|<sup>||To give a superscript effect to any text.|
|<strike>||For displaying any text as strikethrough.|
|<tt>||For displaying any font as a mono-spaced font. This tag is abbreviated as a typewriter type font tag.|
Let's check this out by using an example program:
<!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" button above to see how the code works.