HTML | <body> bgcolor Attribute
The HTML <body> bgcolor Attribute is used to define a Background color of a Document.
Syntax:
<body bgcolor="color_name | hex_number | rgb_number">
Attribute Values:
- color_name: It specify the name of the Background color of the Document.
- hex_number: It specify the hex code of the Background color in the Document.
- rgb_number: It specify the rgb value of the Background color in the Document
Example:
<!DOCTYPE html> < html > < head > < title > HTML body Bgcolor Attribute </ title > </ head > <!-- body tag starts here --> < body text = "green" bgcolor = "orange" > < center > < h1 >GeeksforGeeks</ h1 > < h2 > HTML < body > bgcolor 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> bgcolor are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera