HTML Formatting

Formatting is one of the crucial sections of every development. For making any project or article or content looks attractive, readable and user-intractable, formatting plays a very important role. Formatting can be defined as the appearance of your documentation or presentation of your HTML code in a meaningful and nicer way. Formatting is mainly done for making the layout attractable.

HTML provides various formatting tags. They are collectively called as formatting tags because they are meant for the above-mentioned purpose. 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 needs 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 in size then the rest of the texts surrounded.
<del>To show texts that have been deleted or removed or replaced.
<ins>To show texts that have been inserted or added
<sub>For giving any text the subscript effect.
<sup>For giving any text the superscript effect.
<strike>For displaying any text as strikethrough.
<tt>For displaying any font as a mono-spaced font. This tag is abbreviated as typewriter type font tag.

Let's check this out by using an example program:

<!DOCTYPE html>
    <title>Formatting elements example</title>

    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

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

Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.