Learning HTML 3.2 by Examples, section 5 Descriptions of HTML 3.2 tags:

BASEFONT - base font size (Not in HTML 2.0!)


To specify the base font size (relatively to other sizes).

Typical rendering

BASEFONT sets the base (default) font size. The base font size applies to normal and preformatted text but not to headings, except where these are modified using the FONT element with a relative font size (e.g. FONT SIZE="+1").

It is not obvious whether it applies to tables. In Netscape, for example, BASEFONT does not affect the font size within tables. (Thus, to affect the font size within tables you must insert font changing elements into each cell!)

The actual font sizes used depend on the browser. See rendering notes about the FONT element.

Basic syntax


Possible attributes

attribute name possible values meaning
SIZE string size of the font (1 - 7)

It is not obvious from the HTML 3.2 Reference Specification whether the SIZE attribute here follows the same rules as in the FONT element or has to be just an unsigned integer.

Allowed context

Text container, i.e. any element that may contain text elements. This includes most HTML elements. In particular, text elements can be nested.




Example BASEFONT-1.html:

<P>This is text with default font size (3).</P>
<P>This is text with font size 5 with <FONT SIZE=1>some text</FONT>
inserted with font size 1.</P>


Avoid using BASEFONT, for reasons explained in the discussion of text markup in general. In HTML 4.0, the BASEFONT element is deprecated in favor of style sheets.

Use FONT or, more preferably, SMALL or BIG to set font size locally (but notice that paragraph breaks are not allowed within FONT.)

BASEFONT can be regarded as a global counterpart for FONT with SIZE. In a sense, BODY with TEXT is a global counterpart for FONT with COLOR.

Date of last update: 2010-12-16.
This page belongs to the free information site IT and communication, section Web authoring and surfing, by Jukka "Yucca" Korpela.