Deprecated in HTML5. Do not use.

<basefont color=""> HTML Attribute

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
<basefont> HTML Tag
What does <basefont color=""> HTML Attribute do?
Used to set the text color for a whole document. Deprecated. Use CSS instead.

The right way to set the base font color

Use CSS for all font styling. The color property is used to define the font color, usually using hex color or RGB color values. Setting the color in the body selector assigns that color to everything on a page (unless overridden by a more specific directive).

/* By Hex Color */
body {
 color: #000000;

/* By RGB Value */
body {
 color: rgb(0,0,0);

/* By Common Name */
body {
 color: black;

Specifying colors by hex-number is, by far, the most common.

Adam is a technical writer who specializes in developer documentation and tutorials.