Teach Yourself HTML Home   Basics Main Tags Fonts Tables Lists Links


Using the <FONT> tag, HTML allows you to alter many attributes of text:
Colour
Face
Size
Styles


COLOR
Applies colour to the contained text. This attribute uses the RGB colour scheme.
For example red is #ff0000, green is #00ff00 and blue is #0000ff.
A chart demonstrating RGB colours is available here.
Modern browsers will also accept named colours in the color tag.
For example, "Red", "Green", or "Blue" can be used instead of their RGB equivalents.

FACE
This is the font style. Since there are many variations of computers, OS's and browsers, you cannot guarantee the viewing machine has the font required for your web page. Therefore, it is wise not to use obscure fonts and also provide at least 2 alternative fonts.

SIZE
This simply defines the size of displayed text. It can either be an absolute point size (1-7), or a size relative (-7 - +7) to the browser default font size.

In addition to the above attributes of the <FONT> tag, the following tags can also be used independently:

BOLD
All the text within this pair of tags will be BOLD.

STRONG
All the text within this pair of tags will be of STRONG weight. (Quite similiar to bold)

ITALICS
All the text within this pair of tags will be in ITALIC.

UNDERLINED
All the text within this pair of tags will be UNDERLINED.

When combining multiple effects to text, remember to keep all the tags in order,
ie: "First opened - last closed".

  • <B><I> text </I></B> is correct but
  • <B><I> text </B></I> is not !!
Code Example
The following code example renders like this: Text

<FONT FACE="Verdana, Helvetica, Sans-serif" SIZE="3" COLOR="#FF0000">Text</FONT>

Contact me   Back to top