HTML Text Formatting

This page shows tags that are used to format HTML text and provides a description of what they do.

There are many tags used to format text. They are listed below:

  • <b>..</b> - Sets bold text.
  • <big>..</big> - Sets larger than normal text.
  • <em>..</em> - Sets text in italics and denotes emphasis.
  • <i>..</i> - Sets text in italics.
  • <small>..</small> - Makes text smaller than normal.
  • <strike>..</strike> - Draws a line through the text as a "strikeout".
  • <strong>..</strong> - Same as bold but denotes strong emphasis.
  • <super>..</super> -Superscript.
  • <tt>..</tt> - Monospaced typewriter font.
  • <u>..</u> - Underlined text.
  • <var>..</var> - Mark a variable.

Examples

Here's the HTML code:

This is an example of the <b>&#60;b&#62; tag </b>.<br>
This is an example of the <big>&#60;big&#62; tag</big>.<br>
This is an example of the <em>&#60;em&#62; tag</em><br>
This is an example of the <i>&#60;i&#62; tag</i>.<br>
This is an example of the <small>&#60;small&#62; tag</small>.<br>
This is an example of the <strike>&#60;strike&#62; tag</strike>.<br>
This is an example of the <strong>&#60;strong&#62; tag<strong>.<br>
This is an example of the <sup>&#60;sup&#62; tag<sup>.<br>
This is an example of the <sub>&#60;sub&#62; tag<sub>.<br>
This is an example of the <tt>&#60;tt&#62; tag<tt>.<br>
This is an example of the <u>&#60;u&#62; tag</u><br>
This is an example of the <var>&#60;var&#62; tag</var><br>

Here's how it looks:




This is an example of the <b> tag.
This is an example of the <big> tag.
This is an example of the <em> tag.
This is an example of the <i> tag.
This is an example of the <small> tag.
This is an example of the <strike> tag.
This is an example of the <strong> tag.
This is an example of the <sup> tag.
This is an example of the <sub> tag.
This is an example of the <TT> tag.
This is an example of the <u> tag.
This is an example of the <var> tag.

Other tags associated with text are:

  • ABBREV - Denotes an abbreviation
  • ACRONYM
  • AU - Author
  • CODE - Denotes program code and should be set in the same format as the PRE tag, but does not work either with all browsers or all HTML versions.
  • DEL - Denotes deleted text.
  • DFN - Denotes the definition of a term
  • INS - Denotes inserted text
  • KBD - Text to be typed at the keyboard, such as a computer command. The test is displayed in a mono spaced format.
  • PERSON
  • Q - Quotation.
  • SAMP - Denotes sample text.

Each of these tags require an ending tag.


The FONT tag

The font element is being depreciated and replaced by style sheet attributes. The <FONT> element is used to set a section of text with a specific font. It uses the <FONT> tag to begin and the </FONT> for the end tag.

FONT Attributes and Tags

  • <FONT> - Begins the FONT element.
    • SIZE="4" - Sets the font size using a value, between 1 and 7. The default value is 3. It can be specified with a "+n" value to set the size relative to the current size.
    • COLOR="blue" - Sets the text color.
    • FACE="roman" - The font name to be used. If there is more than one font name separated by commas the first font that can be found is used.
  • </FONT> - Ends the FONT element.
  • <BASEFONT> - Used to set the default font size on the current page.
    • SIZE="2" - Specifies default font size with a value between 1 and 7.