Easy Tutorial
❮ Att Table Frame Canvas Transform ❯

HTML <body> text Attribute

HTML <body> Tag

Example

Set the text color in an HTML document:


Browser Support

All major browsers support the text attribute.


Definition and Usage

The text attribute of <body> is deprecated in HTML 4.01.

The text attribute specifies the text color of an HTML document.


Compatibility Notes

In HTML 4.01, the text attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the text attribute of the body element is not supported. Use CSS instead.

CSS Syntax (in the <head> section): <style>body{color:green}</style>

CSS Example: Set the text color in a document

In our CSS tutorial, you can find more information about the text color property.


Syntax

Attribute Values

Value Description
color_name Specifies the font color with a color name (e.g., "red").
hex_number Specifies the font color with a hexadecimal value (e.g., "#ff0000").
rgb_number Specifies the font color with an rgb code (e.g., "rgb(255,0,0)").

❮ Att Table Frame Canvas Transform ❯