Javatpoint Logo
Javatpoint Logo

HTML font color

The Color is an attribute of <font> tag, which specifies the text color.

Syntax

We can specify the text color with the following different attribute values:

  • Color_name: This value sets the color of a text by the name of a color.

Example:

  • Rgb_number: This value sets the color of a text by the RGB code.

Example:

  • Hex_number: This value sets the color of a text by the hex code.

Examples: The following examples use the different value of color attribute:

Example 1: The following example uses the name of a color:

Test it Now

Output:

HTML font color

Example 2: The following example uses the hex code for defining the text color:

Test it Now

Output:

HTML font color

Example 3: The following example uses the rgb number for defining the text color:

Test it Now

Output:

HTML font color

Example 4: The following example uses all the attribute values for the font color.

Test it Now

Output:

HTML font color

Browser Support

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<font color=''">YesYesYesYesYes

Next TopicHTML Font Size




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA