Open In App

HTML | body text Attribute

The HTML <body> text Attribute is used to define a color for the text in the Document. 
Note: The <body> text attribute is not supported by HTML5.  Instead of using this attribute, we can use css color property. 

Syntax: 
 



<body text="color_name | hex_number | rgb_number">

Attribute Values 
 

Example: 
 






<!DOCTYPE html>
<html>
 
<head>
    <title>HTML body Text Attribute</title>
</head>
 
<!-- body tag starts here -->
 
<body text="green">
    <center>
        <h1>GeeksforGeeks</h1>
        <h2>HTML <body> Text Attribute</h2>
         
 
 
<p>It is a Computer Science portal For Geeks</p>
 
 
 
    </center>
</body>
<!-- body tag ends here -->
 
</html>

Output: 
 

Supported Browsers: The browser supported by <body> Text Attribute are listed below: 
 

 

Article Tags :