#What is the attribute used for the background color of the body element in html?
#The attribute of the body element used to set the background color is bgcolor.
Syntax:
The bgcolor attribute is used to specify the background color of the document
Example:
<html> <body bgcolor="#E6E6FA"> <p><a href="http://www.w3school.com.cn">W3School.com.cn</a></p> <p><a href="http://www.w3school.com.cn/html/">HTML Tutorial</a></p> </body> </html>
Compatibility Notes
In HTML 4.01, the use of the bgcolor attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the body element is not supported bgcolor attribute.
Please use CSS instead.
CSS syntax:
Recommended tutorial: "HTML Tutorial"
The above is the detailed content of What is the attribute used to set the background color of the body element in html?. For more information, please follow other related articles on the PHP Chinese website!