Definition and Usage The background attribute specifies the URL of an image to use as a background for a page. Compatibility Notes The back...
Definition and Usage
The background attribute specifies the URL of an image to use as a background for a page.
Compatibility Notes
The background 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-image: url(background.jpg)">
Syntax
Syntax Example
<body background="background.jpg"> |
Attribute Values
Value | Description |
URL | The web resource/address of the background image. Possible values:
- An absolute URL - Is used to navigate to another web site (like background="www.example.com/background.jpg")
- A relative URL - Is used to navigate within a site (like background="background.jpg")
|
Browser Support
The attribute is supported in all major browsers.
Example
<html>
<body background="background.jpg">
<p>Welcome to 1000sourcecodes.com</p>
</body>
</html> |