JSSTag.fontSize (Property)

The font size for an object.


CSS level - 1
JavaScript - 1.2
Netscape - 4.0
Property/method value type:String primitive
JavaScript syntax:NmyJSSTag.fontSize
NmyJSSTag.fontSize = aSizeValue
CSS syntax:font-size: aSizeValue
HTML syntax:<FONT SIZE="...">
Argument list:aSizeValueA size value as described

The JSSTag.fontSize property corresponds to the font-size CSS property. It controls the size of the text as it appears on the screen.

This is notoriously unportable and text always looks smaller on a Macintosh than it does on a Windows system. This is because the native screen resolution of a Macintosh is 72 dpi and a Windows system is 96 dpi.

You can specify the size in a variety of ways. There are four classifications for the font size value:

The length value can be specified in units of measure as follows:

Points - e.g. 12pt

Millimetres - e.g. 0.4mm

Pixels - e.g. 16px

The percentage value is computed relative to the enclosing object's corresponding property (hence the cascading effect of style sheets). A percentage value is indicated with an integer followed by a percent sign, for example 120%.

The absolute size is based on the browser knowing the screen display resolution and computing some preferred font sizes. It is specified using the following keywords:

Note that some of the smaller sizes render so small on a Macintosh as to be unreadable.

The relative sizing is controlled by the two keywords:

You can use a combination of absolute and relative sizing or any combination of sizes as this property is cascaded down through the styles.

The default value for this property is "medium".

This value is inherited from its parent container element.


See also:Measurement units, style.fontSize