Latest

recent

HTML body bgcolor Attribute

Definition and Usage

The bgcolor attribute specifies the background color of the page.

Compatibility Notes

The bgcolor 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: <body style="background-color: #1E90FF">

Syntax

<body bgcolor="color_value">

Syntax Example

<body bgcolor="#00BFFF">

Attribute Values

Value Description
color_name Specifies the background color with a color name, like "red"
RGB_value Specifies the background color with a RGB value, like "rgb(255,0,0)"
Hex_value Specifies the background color with a hex value, like "#ff0000"


Browser Support

The attribute is supported in all major browsers.

Example

<html>
<body bgcolor="#00BFFF">
<p>Hello World!</p>
</body>
</html>
HTML body bgcolor Attribute Reviewed by 1000sourcecodes on 08:43 Rating: 5
Powered by Blogger.