How to Formatting a Text

You have worked on MS Word. You must be familiar with the formatting of text to make it pear bold, italicized or underlined. Similarly‚ you can indicate how text can appear in HTML.

Use of Font

In HTML, the <FONT> element is used to set a part of the text with a specific font. The <FONT> tag is used as the start tag and </FONT> is used as the end tag.

FONT Attributes

  • < SIZE=”4″ > sets the font size (here it is 4). The value has to be between 1 and 7, 1 being the smallest size and 7 the biggest size. The default value is 3. Other sizes can be specified with a ”+n” value to set the size relative to the current size.
  • COLOR: sets the color of the text given within, color value is as per the RGB format.
  • FACE: sets the font type to be used for the enclosed text. The font name needs to be specified.
  • These attributes can be used individually or together, e.g.

<font face=”Comic Sans MS” color=”navy” size=”5”>

While <font> tag helps to set the font properties for a selected part of the text, the <Basefont> tag sets the default font properties on the current page. It uses the same attributes as that of <Font> tag.

Style Tags

These elements specify how the text will appear on the web page. Some of the most used style tags are:

<b>…</b>: Makes the text hold.

<i>….</i>: Italicizes the text given within.

<u>…</u>: Makes the text underlined.

<em>..</em>: Emphasises text.

<small>..</small>z Makes text smaller than normal. <strike>..</strike>: Draws a line through the text as a ”strikeout <strong>..</strong>z Same as bald but denotes strong emphasis.

<sup>..</sup>z Superscripts the text given within, i.e. places the text little above the normal text line.

<sub>….</sub>z Subscripts the text, places it a little below the normal text line. <del>: Deleted text

<lm>: Inserted text.