Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | body text Attribute

  • Last Updated : 16 Apr, 2021

The HTML <body> text Attribute is used to define a color for the text in the Document. 
Syntax: 
 

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

Attribute Values 
 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

  • color_name: It specify the name of the color for the text in the Document.
  • hex_number: It specify the hex code of the color of the Text in the Document.
  • rgb_number: It specify the rgb value of the Text in the Document

Example: 
 

html




<!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: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!