". The "bgcolor" attribute of the body element can specify the background color of the html document."/> ". The "bgcolor" attribute of the body element can specify the background color of the html document.">

Home  >  Article  >  Web Front-end  >  What is the attribute used to set the background color of the body element in html?

What is the attribute used to set the background color of the body element in html?

烟雨青岚
烟雨青岚Original
2020-06-20 16:42:0511263browse

What is the attribute used to set the background color of the body element in html?

#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: 474683cb94de842b9fd6e4f79e2818a6

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: 35ff67caecb0998c927a2590c2952058

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn