], where color_name indicates that the color value is the background color of the color name."/> ], where color_name indicates that the color value is the background color of the color name.">
Home > Article > Web Front-end > What is the attribute of the body element used for background color?
The attribute used by the body element for background color is bgcolor. The bgcolor attribute is used to specify the background color of the table. Syntax structure: [ ], where color_name indicates that the specified color value is the background color of the color name.
The attribute bgcolor of the body element is used for the background color.
(Recommended tutorial: html tutorial)
Attribute introduction:
bgcolor attribute is used to specify the background color of the table.
Grammar structure:
<body bgcolor="value">
Attribute value introduction:
color_name Specifies that the color value is the background color of the color name (such as "red" ).
hex_number specifies the background color whose color value is a hexadecimal value (such as "#ff0000").
rgb_number specifies the color value as the background color of the rgb code (such as "rgb(255,0,0)").
Note:
In HTML 4.01, the use of the bgcolor attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the bgcolor attribute of the body element is not supported.
It is recommended to use CSS instead.
CSS syntax:
<table style="background-color:red">
The above is the detailed content of What is the attribute of the body element used for background color?. For more information, please follow other related articles on the PHP Chinese website!