HTML body background property
Examples
The document specifies a background image:
<html>
<body background="bg.gif">
<h1>Hello world!</h1>
<p><a href="http://www.w3big.com">访问本教程!</a></p>
</body>
</html>
<body background="bg.gif">
<h1>Hello world!</h1>
<p><a href="http://www.w3big.com">访问本教程!</a></p>
</body>
</html>
try it"
Browser Support
All major browsers support background attributes.
Definition and Usage
HTML5 is no longer supported <body> background attributes. Use CSS instead.
<Body> The background attribute is deprecated in HTML 4.01.
background attribute specifies a background image specified document.
Compatibility Notes
In HTML 4.01 deprecated background attribute of the body element; in XHTML 1.0 Strict DTD not supported background attribute of the body element. Use CSS instead.
CSS Syntax: <body style = "background-image: url (bgimage.jpg)">
CSS Example: Add a background image to a document
In our CSS tutorial you can find more information about the background-image property knowledge.
grammar
<body background="URL">
Property Value
value | description |
---|---|
URL | URL of the background image. Possible values:
|
HTML <body> tag