1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Formatting in HTML

Discussion in 'Web Design, HTML And CSS' started by MinalS, Jun 12, 2016.

  1. MinalS

    MinalS New Member

    Joined:
    Jul 8, 2014
    Messages:
    138
    Likes Received:
    30
    Trophy Points:
    0
    In HTML, formatting the elements were useful in showing text with special meaning. Special elements of HTML are useful for defining text with particular meaning. Learn about different formatting with appropriate examples.

    Bold formatting



    Using the bold formatting the text is displayed in bold format. The <b>..</b> tag is used for displaying bold formatting tag

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Bold formatting</title>
    </head>
    <body>
    <p>A <b>new</b>technology is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Italic formatting



    The <i>…</i> tag is used for italic formatting.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Italic formatting</title>
    </head>
    <body>
    <p>A <i>new</i> technology is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Small formatting



    The <small>…</small> tag is used for displaying the text in one font size smaller than the other text in the document.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Small formatting</title>
    </head>
    <body>
    <p>A <small>new</small> technology is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Marked formatting



    The <mark> element is used for making or highlighting the text in a document.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Marked formatting</title>
    </head>
    <body>
    <p>A new <mark>technology</mark> is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Deleted formatting



    The <del>…</del> element is useful for displaying the deleted formatting.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Deleted formatting</title>
    </head>
    <body>
    <p>A <del>new</del> technology is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Inserted formatting



    The <ins>…</ins> element is used for inserting the text in an html document.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Inserted formatting</title>
    </head>
    <body>
    <p>A <del>new</del><ins>latest</ins> technology is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Superscript formatting



    The <sup>…</sup> element is used for writing the superscript. The size of the font is same as the characters next to it. The text is displayed half above the height the other characters.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Superscript formatting</title>
    </head>
    <body>
    <p>A new  <sup>technology</sup> is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]

    Subscript formatting



    The <sub>…</sub> element is used for writing the subscript. The size of the font is same as the characters next to it. The text is displayed half below the height the other characters.

    Example:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Subscript formatting</title>
    </head>
    <body>
    <p>A new <sub>technology</sub> is widely used</p>
    </body>
    </html>
    
    Output:

    [​IMG]
     

Share This Page