The <basefont> element was used to set the default font characteristics for the text of an HTML document. Since it is now deprecated, CSS properties like the font property should be used instead. To set the font of specific parts of the webpage the <font> element would be used in combination with the <basefont> element.


<basefont> must be a child of the element. Any combination of the following three attributes could be used in the <font> element, with at least one being required:

  • color: Sets the color for the font/text using a named color, hexadecimal, or RGB.
  • face: Sets the font for the text (e.g., face="verdana").
  • size: Sets the size of the font/text using absolute units ranging from 1-7 (e.g., size="5").


<basefont size="5" font="verdana" color="green" />
This text should be size 5 the font should be verdana and the color should
be green.

Output of the basefont tag example


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn HTML on Codecademy