Definition and Usage The text attribute specifies the color text for a page. Text includes all text elements (like paragraphs, divs, and he...
Definition and Usage
The text attribute specifies the color text for a page.Text includes all text elements (like paragraphs, divs, and headers).
Compatibility Notes
The text attribute of the body element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.Use CSS instead.
CSS syntax (in <head>): <style>body{color:red}</style>
Syntax
<body text="color_value"> |
Syntax Example
<body text="#00008B"> |
Attribute Values
Value | Description |
---|---|
color_name | Specifies the text color with a color name, like "red" |
RGB_value | Specifies the text color with a RGB value, like "rgb(255,0,0)" |
Hex_value | Specifies the text color with a hex value, like "#ff0000" |
Browser Support
The attribute is supported in all major browsers.Example
<html> <body text="#00008B"> <p>Welcome to 1000sourcecodes.com</p> </body> </html> |