HTML Text Formatting

 HTML Text Formatting

Formating text is very essential for web sites.

One of its uses to help readers know the important parts a web content easily.

Elements for Formatting Text

All of the elements listed below are inline elements.
  • <b> : Bolds a text
  • <i> : Italicizes a text
  • <u> : Underline a text
  • <code> : Defines a text as a code
  • <tt> : Typewriter text
  • <small> : Makes a text smaller
  • <em> : Emphasizes a text, may be italicized depending on the browser
  • <strong> : Emphasizes a text, may be italicized depending on the browser
  • <mark> : Marks a text like a highlighting pen
  • <q> : Enquotes a text
  • <s> : Strikes through a text

Example:

<!doctype html>
<html>
    <head>
        <title> Text Formatting </title>
    </head>
    <body>
        <!--bold-->
        <b>I am bolded text.</b>
        <br />
        <!--italic-->
        <i>I am italic text.</i>
        <br />
        <!--underline-->
        <u>I am underlined text</u>
        <br />
        <!--code-->
        <code>I am a code text.</code>
        <br />
        <!--typewriter text-->
        <tr>I am a typewriter text.</tr>
        <br />
        <!--small text-->
        <small>I am a smalled text.</small>
        <br />
        <!--emphasized text-->
        <em>I am a emphasized text.</em>
        <br />
        <!--strong text-->
        <strong>I am a strong text.</strong>
        <br />
        <!--marked text-->
        <mark>I am a marked text.</mark>
        <br />
        <!--quoted text-->
        <q>I am enquoted text.</q>
        <br />
        <!--striked text-->
        <s>I am a striked text.</s>
        <br />
        <!--mixed formatted-->
        <b><i><u><mark><q>I am a mixed formatted text.</q></mark></u></i></b>
    </body>
</html>

Output:



    
                                                                                

Post a Comment

Post a Comment (0)