Pr.Pg Next Pg

<BASEFONT> tag tutorials

  • This is a singular tag element. It does not require closing tag.

  • This sets settings for default text within a document. All <FONT> settings within the document are relative to settings specified with this tags.

NOTE: Though it can be placed in <BODY> block. We advise you to place it within <HEAD> Block.

  • SIZE = No. from 1 to 7: This attribute of <BASEFONT> element helps you to change the default text size of document. It can have any values from 1 to 7. By default (Normal setting) SIZE is set to 3.


Note: <BASEFONT SIZE=1> set text to the SMALLEST SIZE while,

  • <BASEFONT SIZE=7> set text to the LARGEST SIZE.

  • FACE = Font name1, Font name 2, …..: This attribute of <BASEFONT> element allows you to specify default font to be displayed in web browser. It is advisable to provide more than one font with (,) comma as a separator. Because the Browser will search for the First font name, If the browser doesn’t find the first font name, it tries with second name, then the third name and so on. As the name of the font specified must be installed on Computer, as far as possible take fonts that are widely available on most of the Operating System.

  • FONTS like VERDANA, ARIAL, TIMES NEW ROMAN & COURIER are most common fonts on Windows OS while Defaults font for MAC is HELVENTICA.

  • COLOR = Hexadecimal code or Color name: This attribute of <BASEFONT> element allows you to specify color of the font. One can give text color by specifying Color name or by giving Hexadecimal value.


Note: The <basefont> tag is only supported in Internet Explorer 9, and earlier versions.




<basefont size=”number” color= “hexadecimal code or color name” “face=fontname”>



Example: HTML program to demonstrate basefont

Pr.Pg border                                              Next Pg