<FONT> tag specifies font size, font face and font color of the text.

 

 

 

 

 


This is font size 4. This is decreased font size -2. This is Arial font. This is colored font.
This is colored Arial font size 4.
  figure above shows font size, font face and font color.
<HTML>
  <BODY>
    <FONT SIZE="4">This is font size 4.</FONT>
    <FONT SIZE= "-2">This is decreased font size -2.</FONT>
    <FONT FACE="Arial">This is Arial font.</FONT>
    <FONT COLOR="#6699FF">This is a colored font.</FONT><BR/>
    <FONT SIZE="4" FACE="Arial" COLOR="#6699FF">
      This is colored Arial font size 4.
    </FONT>
  </BODY>
<HTML>

<FONT> Optional Attributes :
size <FONT SIZE = fontsize_value > specifies font size.
fontsize_value = a number to specify font size.
face <FONT FACE = fontface_value >

specifies font style.
fontface_value = name of font type eg.arial, tahoma.

color <FONT COLOR = fontcolor_value >

specifies font color.
fontcolor_value = can be font name eg. red, blue or can be in RGB eg.#FF0000.


Other Attributes :
Core Attributes class, id, style, title.
Internationalization Attributes lang, dir.
Event Attributes onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

  Below describe the attributes for <FONT> tag in detail.


Core Attributes

Attribute Syntax Description
CLASS

eg. an element's class :
<ELEMENT CLASS = stClass...>

eg. multiple classes in an element :
<ELEMENT CLASS = stClass [ stClass2 [ stClass3 ... ] ] ... >

 

An element can belong to multiple classes.
Multiple elements can share the same class.

Common Usage : to associate a particular style rule in a style sheet with the element.

stClass = a string of class attribute value

Attribute value for CLASS is space-separated list of class names. Begin with a letter range from A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). The value is case-sensitive.

ID <ELEMENT ID = stID... >

A unique id for an element.

Common Usage : as a target for links or for naming particular elements in a style sheet.

stID = a string which specifies attribute value for ID

Attribute value for ID begin with a letter range from A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). The value is case-sensitive.

STYLE <ELEMENT STYLE = stStyle ... >

Specify an inline style for the element.

Common Usage : to associate a particular style sheet rule for the element.

stStyle = a string to specifies the inline style type.

Attribute value for STYLE is the type of the style sheet language or style rules.
Eg. <ELEMENT STYLE="font-family: Verdana">text...</ELEMENT>.

TITLE <ELEMENT TITLE = stTitle... >

Specify the title for the element.

Common Usage : as a tooltip to retrieve advisory information when user hover the mouse over the object.

stTitle = a string that specifies the title attribute value.

Attribute value for TITLE is space/non space-separated list of text.

Internationalization Attributes

Attribute Syntax Description
DIR <ELEMENT DIR = stDir... >

Sets the text direction

stDir = attribute value for DIR

Attribute value for DIR is the directionality of text from left-to-right (DIR=ltr, the default) or right-to-left (DIR=rtl).

LANG <ELEMENT LANG = stLang... >

Sets the language code

stLang = attribute value for LANG

Attribute value for LANG is non space-separated, case-insensitive with the following values : (LANG=en) for English, (LANG=ja) for Japanese and etc.